hi
i can see that there are several threads with macro that automatically refresh a pivottable. i have found this macro below
Private Sub Worksheet_Activate()
'If this worksheet is activated, refresh the pivot table
Sheets("sheet4").PivotTables("PivotTable1").RefreshTable
End Sub
my problem is that the pivottable sheet (sheet4 in this example above) would be sheet5 one month, sheet 6 the next and so on. how would the macro above be amended to accomodate this.
thanks
i can see that there are several threads with macro that automatically refresh a pivottable. i have found this macro below
Private Sub Worksheet_Activate()
'If this worksheet is activated, refresh the pivot table
Sheets("sheet4").PivotTables("PivotTable1").RefreshTable
End Sub
my problem is that the pivottable sheet (sheet4 in this example above) would be sheet5 one month, sheet 6 the next and so on. how would the macro above be amended to accomodate this.
thanks