I\'m trying to select one report filter, in this case Canada. That means the rest must be made invisible. This code works without issue:
Public Sub FilterPiv
Is this what you are trying?
Sub Sample()
Dim Pi As PivotItem
With ActiveSheet.PivotTables("Epidemiology").PivotFields("COUNTRY")
.PivotItems("Canada").Visible = True
For Each Pi In .PivotItems
If UCase(Pi.Value) = "CANADA" Then
Pi.Visible = True
Else
Pi.Visible = False
End If
Next Pi
End With
End Sub