Hi,
I am trying to change the pivot filters in a worksheet for all the pivot tables. I tried the code below and it does not work. Can anyone please help! (Level 4,5, and 1 are my pivot fields)
Thank you!
I am trying to change the pivot filters in a worksheet for all the pivot tables. I tried the code below and it does not work. Can anyone please help! (Level 4,5, and 1 are my pivot fields)
Code:
[I]Sub Reset_filters()[/I]
[I]Dim pt As PivotTable[/I]
[I]For Each pt In Sheets("Rates Pivot").PivotTables[/I]
[I] With pt.PivotFields( _
"Level 4").ClearAllFilters
pt.PivotFields( _
"Level 4").CurrentPage = Sheets("Maps").Range("G2").Value
pt.PivotFields( _
"Level 5").ClearAllFilters
pt.PivotFields( _
"Level 5").CurrentPage = Sheets("Maps").Range("H2").Value
pt.PivotFields("Cons Mgmt Location Level 1" _
).ClearAllFilters
pt.PivotFields("Cons Mgmt Location Level 1" _
).CurrentPage = Sheets("Maps").Range("F2").Value
End With[/I]
[I]Next pt[/I]
[I]End Sub[/I]
Thank you!