right now i have this...
but i'd like this to be more flexible and dynamic. so, rather than hardcode the item "811" and "911"....i'd like the macro to filter the report filter items by looping through a range somewhere in the spreadsheet.
so, let's say in sheet1 column A....I have 811 in A1, 911, in A2, and perhaps more in the future, and I gave it a named range "filter" (which uses an offset formula to make the named range dynamic). So the macro filters the report filter based on the named range "filter."
Code:
With pf
For Each pi In pf.PivotItems
If pi.Name = "811" or pi.name = "911" Then
pi.Visible = True
Else
pi.Visible = False
End If
Next pi
End With
but i'd like this to be more flexible and dynamic. so, rather than hardcode the item "811" and "911"....i'd like the macro to filter the report filter items by looping through a range somewhere in the spreadsheet.
so, let's say in sheet1 column A....I have 811 in A1, 911, in A2, and perhaps more in the future, and I gave it a named range "filter" (which uses an offset formula to make the named range dynamic). So the macro filters the report filter based on the named range "filter."