In my macro I use a basic routine twice to only show a small selection from a vast array of pivot items (Pi and PT are previously defined):
On Error Resume Next
For Each Pi In PT.PivotFields("Posn Func").PivotItems
Select Case Pi.Name
Case "0025", "0058", "0059", "0109", "0110"
Case Else
Pi.Visible = False
End Select
Next Pi
On Error GoTo 0
On Error Resume Next
For Each Pi In PT.PivotFields("Department").PivotItems
Select Case Pi.Name
Case "510", "511", "513", "514", "516", "517"
Case Else
Pi.Visible = False
End Select
Next Pi
On Error GoTo 0
The oveall macro works just fine, but Extremely Slowly. I have Manual Updating turned to True, and Screen Updating turned off. Walking through the code, it's these two PivotItems sections that are slowing everything down. Is there a faster way to do this?
Any help is highly appreciated.
Bookmarks