I have a data set for the past 11 months (from Apr 2019 to Feb 2020). I have created a pivot wherein I am trying to filter for all months except the current month. The Month is in the format - 1, 2, 3... and so on. The code I am using is as follows -
With ActiveSheet.PivotTables("Summary_2").PivotFields("Month")
.Orientation = xlPageField
.Position = 3
ActiveSheet.PivotTables("Summary_2").PivotFields("Month").CurrentPage = "(All)"
ActiveSheet.PivotTables("Summary_2").PivotFields("Month"). _
EnableMultiplePageItems = True
For Each pit In ActiveSheet.PivotTables("Summary_2").PivotFields("Month")
.PivotItems("" = "& v").Visible = False
Next
End With
I am unable to get any result from this. Can anyone help me?