Forum Discussion
clh_1496
Mar 03, 2022Brass Contributor
Pivot Table Data 'Refresh data when opening file'
Hi, I'm looking for a VBA that runs as a macro once and ticks the 'Refresh Data when opening the file' for every pivot table in the workbook rather than having to do it manually. I saw this code...
- Mar 03, 2022
Sub RefreshOnOpenAll() Dim pvc As PivotCache For Each pvc In ActiveWorkbook.PivotCaches pvc.RefreshOnFileOpen = True Next pvc End Sub
HansVogelaar
Mar 03, 2022MVP
Sub RefreshOnOpenAll()
Dim pvc As PivotCache
For Each pvc In ActiveWorkbook.PivotCaches
pvc.RefreshOnFileOpen = True
Next pvc
End Sub
clh_1496
Mar 14, 2022Brass Contributor
Amazing, thank you!