I want to refresh all my pivot tables but I'm getting an error. "Unable to get pivot table property of worksheet class" Also, I don't think this updates my source data... my pivot table source increases in size so how do I make the pivot table to pick up the new data also?
Dim Pt As PivotTable
Dim Wsht As Worksheet
Application.Cursor = xlWait
For Each Wsht In ThisWorkbook.Worksheets
For Each Pt In Wsht.PivotTables
ActiveSheet.PivotTables(Pt).RefreshTable
Next Pt
Next Wsht
Application.Cursor = xlDefault
Dim Pt As PivotTable
Dim Wsht As Worksheet
Application.Cursor = xlWait
For Each Wsht In ThisWorkbook.Worksheets
For Each Pt In Wsht.PivotTables
ActiveSheet.PivotTables(Pt).RefreshTable
Next Pt
Next Wsht
Application.Cursor = xlDefault