Hi,
I have several pivot tables in a workbook on separate worksheets. Rather than pasting the auto refresh pivot table code for each worksheet that has a pivot table, I would like a single code within the workbook that would refresh the pivot table everytime the worksheet is activated.
I am curently using this code for every worksheet with a pivot table-
Private Sub Worksheet_Activate()
'If this worksheet is activated, refresh the pivot table
Sheets("Pivot").PivotTables("PivotTable").RefreshTable
End Sub
Can you please help. Thanks,
Sabrina
I have several pivot tables in a workbook on separate worksheets. Rather than pasting the auto refresh pivot table code for each worksheet that has a pivot table, I would like a single code within the workbook that would refresh the pivot table everytime the worksheet is activated.
I am curently using this code for every worksheet with a pivot table-
Private Sub Worksheet_Activate()
'If this worksheet is activated, refresh the pivot table
Sheets("Pivot").PivotTables("PivotTable").RefreshTable
End Sub
Can you please help. Thanks,
Sabrina