JeffGrant
Well-known Member
- Joined
- Apr 7, 2021
- Messages
- 516
- Office Version
- 365
- Platform
- Windows
Hi All,
I have a sub like this.
Which calls
On a semi-regular basis, not all of the pivot tables are freshed on the active sheet. I can refresh them manually without any issues, but they are just missed in the loop.
It is not any one particular pivot table that is missed, the missed pivot table changes.
What am I doing incorrectly?
Any guidance is greatly appreciated please.
I have a sub like this.
VBA Code:
Sub RefreshPivotTables()
Sheet1.Activate
Call RefreshActiveSheetPivotTables
Sheet2.Activate
Call RefreshActiveSheetPivotTables
Sheet3.Activate
Call RefreshActiveSheetPivotTables
End Sub
Which calls
VBA Code:
Sub RefreshActiveSheetPivotTables()
Dim PivotTbl As PivotTable
On Error Resume Next
For Each PivotTbl In ActiveSheet.PivotTables
PivotTbl.RefreshTable
Next PivotTbl
End Sub
On a semi-regular basis, not all of the pivot tables are freshed on the active sheet. I can refresh them manually without any issues, but they are just missed in the loop.
It is not any one particular pivot table that is missed, the missed pivot table changes.
What am I doing incorrectly?
Any guidance is greatly appreciated please.