View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
pepenacho pepenacho is offline
external usenet poster
 
Posts: 7
Default Pivot Table(s) - refresh in sheet - macro - automate

Bernie:

All the stuff worked. There seems to be one minor subtle outcome with this
sub. I have 4 tables in my Excel file and about 8 Work Sheets that have
PivotTables, which feed from the tables.

In each Work Sheet I have a button that calls a procedure in a Module called
RefreshAllPivots

Sometimes this seems to refresh all PivotTables in all the Work Sheets, and
sometimes in just that one specific one. What's the catch, I trouble-shooted
this to kingdom come and can't figure it out?

Sub RefreshAllPivots()
Dim myPT As PivotTable
For Each myPT In ActiveSheet.PivotTables
myPT.PivotCache.Refresh
Next
End Sub


Thanks,
Robert