If you're saying you want to copy the Pivot and source data to a new file then one method might be along the lines of:
Sub Example()
Dim boolGTVis As Boolean
With Sheets.Add
Sheets("Sheet1").PivotTables(1).TableRange2.Copy .Range("A1")
.Move
With ActiveSheet.PivotTables(1)
boolGTVis = .ColumnGrand
.ColumnGrand = True
.Parent.Cells.SpecialCells(xlCellTypeLastCell).ShowDetail = True
.ChangePivotCache ActiveWorkbook.PivotCaches.Create(xlDatabase, Selection, xlPivotTableVersion14)
.ColumnGrand = boolGTVis
.Parent.Activate
End With
End With
End Sub
obviously modify per own requirements but in essence the above:
- copies the Pivot to a new sheet
- moves the new sheet to a new file
- drills through on to the Grand Total of that Pivot (to generate values only data set)
- modifies the cache for the Pivot such that it uses this new static data set (from that originally stored in the main file)
Bookmarks