Personally, I went around this a bit differently - I had a pivot table asking for the source of the SQL server, and I used a time slicer to limit the results to a date range. Then I wanted to summarize the summary results in another table.
I selected the "source" pivot table and created a named range called "SourcePivotData".
Create pivot pivot tables using the named range as the source.
In the worksheets for the original pivot table, I put the following code:
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable) 'Update the address of the named range ThisWorkbook.Names("SourcePivotData").RefersTo = "='" & Target.TableRange1.Worksheet.Name & "'!" & Target.TableRange1.AddressLocal 'Refresh any pivot tables that use this as a source Dim pt As PivotTable Application.DisplayAlerts = False For Each pt In Sheet2.PivotTables pt.PivotCache.Refresh Next pt Application.DisplayAlerts = True End Sub
Works well for me! :)
user1641172
source share