This post has been de-listed (Author was flagged for spam)
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
This is driving me insane. I have a spreadsheet that I need to be compatible between regular Excel and Excsel for Mac 2011. The mac that I'm using for testing refuses to throw errors, and just locks up. I've tried various things to troubleshoot this behavior, but it doesn't seem to be the install of the program that is causing issues.
A couple things that I have narrowed down:
Application.EnableEvents. When turning it back on, Excel freezes.
Unprotecting a locked sheet
The only other thing I'm doing with VBA is sorting using AutoFilter and SortFields, like this:
With ws
.Range("$A$1:$P$" & TheLastRow).AutoFilter Field:=5
.Range("$A$1:$P$" & TheLastRow).AutoFilter Field:=5, Criteria1:= _
"Charges"
.AutoFilter.sort.SortFields.Clear
.AutoFilter.sort.SortFields.Add(Range( _
"N1:N" & TheLastRow), xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue.Color _
= RGB(255, 199, 206)
End With
With ws.AutoFilter.sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
And updating PivotTables like this:
For Each pt In ws.PivotTables
With pt
.ClearAllFilters
End With
Next pt
With ws
.PivotTables("Pivot1").PivotCache.Refresh
.PivotTables("Pivot2").PivotCache.Refresh
.PivotTables("Pivot3").PivotCache.Refresh
.PivotTables("Pivot4").PivotCache.Refresh
End With
With ws.PivotTables("Pivot1")
.PivotFields("reason-long").PivotItems("").Visible = False
.PivotFields("disposition").CurrentPage = "Sold"
End With
With ws
.PivotTables("Pivot1").PivotFields("reason").PivotItems("(blank)").Visible = False
.PivotTables("Pivot2").PivotFields("reason").PivotItems("(blank)").Visible = False
.PivotTables("Pivot3").PivotFields("reason").PivotItems("(blank)").Visible = False
End With
But I don't see why this code would cause any problems. Any ideas?
Post Details
- Posted
- 8 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/excel/comme...