Need some help on this one. First time doing anything w/ pivot tables since grad school....
Basically I want to create a for loop where by the filter applied to the table changes w/ each 'i'. Naturally I will create a counter that can do this for me dynamically.
a bit lost on how to do this one... need advice...note this is not all of my code, just the portion i need help w/
sub data()
'the filter that needs changing. Starts @ 0 goes to 25 in 5 yr increments
g_period = 0
Sheet2.Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("GuarPd").CurrentPage = _
"(All)"
' i attempted to record this macro but i am getting an error
With ActiveSheet.PivotTables("PivotTable1").PivotFields("GuarPd")
.PivotItems(g_period).Visible = False
.PivotItems(g_period+5).Visible = True
End With
i am trying to iterate through the different "guarpd"
any help would be great. please and thanks. take care
Bookmarks