Hi,
So, I have one line of code which quickly hides a value in a filter:-
However, I need to do the reverse and only show value "Test" in the filter. This will work, but takes far too long:-
Is there a way to use the same method as in the first example so that it hides all values except "Test"?
Thanks in advance.
So, I have one line of code which quickly hides a value in a filter:-
VBA Code:
ActiveSheet.PivotTables(1).PivotFields("ABC").PivotItems("Test").Visible = False
However, I need to do the reverse and only show value "Test" in the filter. This will work, but takes far too long:-
VBA Code:
Set pt = ActiveSheet.PivotTables(1).PivotFields("ABC")
For Each pi In pt.PivotItems
If pi.Name = "Test" Then pi.Visible = True Else pi.Visible = False
Next pi
Is there a way to use the same method as in the first example so that it hides all values except "Test"?
Thanks in advance.