Pivot tables

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

I have a worksheet with several pivot tables, is there a
way to update the data on all pivot tables? The 'update
data' button on the Pivot table toolbar requires you to
be in a specific pivot table for it to be active.
 
You can use code to refresh all the pivot tables:

Sub RefreshPT()
Dim ws As Worksheet
Dim pt As PivotTable
For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
pt.PivotCache.Refresh
Next pt
Next ws
End Sub
 
Back
Top