ThrottleWorks
Excel Ninja
Hi,
Is it possible to refresh pivot table(s) without knowing name of the pivot table.
I am writing below mentioned code to refresh pivot table.
‘Worksheets("Summary").PivotTables("PivotTable1").PivotCache.Refresh’
Before refreshing pivot, I am checking if pivot table exist in worksheet.
My doubt is, suppose pivot table name is changed in future then macro will give bug.
Is it possible to refresh all the existing pivot tables in the worksheet without knowing their name.
Can anyone please help me in this.
PS - using below mentioned code to check if there are pivot table(s) in worksheet.
Is it possible to refresh pivot table(s) without knowing name of the pivot table.
I am writing below mentioned code to refresh pivot table.
‘Worksheets("Summary").PivotTables("PivotTable1").PivotCache.Refresh’
Before refreshing pivot, I am checking if pivot table exist in worksheet.
My doubt is, suppose pivot table name is changed in future then macro will give bug.
Is it possible to refresh all the existing pivot tables in the worksheet without knowing their name.
Can anyone please help me in this.
PS - using below mentioned code to check if there are pivot table(s) in worksheet.
Code:
For iCtr = 1 To Worksheets("Summary").PivotTables.Count
Next iCtr
If iCtr = 1 Then
MsgBox "No Pivot table in ABook.name "
ABook.Close
End
Else
Worksheets("Summary").PivotTables("PivotTable1").PivotCache.Refresh
End If
iCtr = 0