View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Candyman Candyman is offline
external usenet poster
 
Posts: 66
Default Macro to Refresh child pivot table

Now I am pretty rough at this, but the pivot tables are a function of the
worksheet. They can also be named (like a range).
For Each WS In Worksheets
For Each PT In WS.PivotTables
PT.PivotCache.Refresh
Next PT
Next WS

try renaming the Parent pivot tables and then pointing the children to those
sources.
"HKS" wrote:

In one workbook, I have three parent pivot tables and ten child pivot tables.
I want a macro to refresh these child tables from different parent tables.
However I always have debug error in the following code. What did I do wrong
here?

Set vTableChild = ActiveCell.PivotTable
Worksheets(vWSMain).PivotTableWizard SourceType:=xlPivotTable,
SourceData:=vTableParent1

Worksheets(vWSChild).PivotTables(vTableChild).Pivo tCache.BackgroundQuery =
True

Thanks