I have 2 pivot tables set up on one sheet in a work book the pivot tables are linked to a report that has to have rolling totals and averages. My solution was to create two pivot tables one to calculate the total and one to calculate the average.
I would like to auto refresh both pivot tables by clicking on the worksheet tab. I am able to refresh the top pivot table with this code, is there a way to refresh both pivot table by selecting the tab?
Code:
Private Sub Worksheet_Activate()
PivotTables(2).PivotCache.Refresh
End Sub
I would like to auto refresh both pivot tables by clicking on the worksheet tab. I am able to refresh the top pivot table with this code, is there a way to refresh both pivot table by selecting the tab?
Code:
Private Sub Worksheet_Activate()
PivotTables(2).PivotCache.Refresh
End Sub