You have a PivotTables collection on a the VB Worksheet object. So, a quick loop like this will work:
Sub RefreshPivotTables() Dim pivotTable As PivotTable For Each pivotTable In ActiveSheet.PivotTables pivotTable.RefreshTable NextEnd Sub
Notes from the trenches:
- Remember to unprotect any protected sheets before updating the PivotTable.
- Save often.
- I'll think of more and update in due course... :)
Good luck!