Auto Refresh Pivot Tables

sdsilva

New Member
Joined
Jul 24, 2009
Messages
2
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
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
NM Sorry. Foggy-brained Friday morning...I replied by giving exactly what you say you do not want...
 
Last edited:
Upvote 0
As an update, I do not want to have the pivot tables refreshed everytime the worksheet is activated, but everytime there is a change to the data file.

If the worksheet is refreshed everytime activated, it refreshes even if there are no changes and takes a while to update as the file is very large.

Thank you for your help.

Regards,
Sabrina
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,122
Members
452,381
Latest member
Nova88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top