Name
pivotcache.CreatePivotTable(TableDestination, [TableName], [ReadData], [DefaultVersion])
Synopsis
Creates a pivot table from the pivot cache and returns the created PivotTable object.
|
Argument |
Settings |
|---|---|
|
|
The |
|
|
A name to assign to the pivot table. Default is |
|
|
If |
|
|
The Excel version assigned to pivot table. Can be |
The following code creates a new pivot table from an existing pivot cache:
Sub CreatePivotTableFromExistingCache( )
Dim pc As PivotCache, pt As PivotTable
' Get an existing pivot cache.
Set pc = ActiveWorkbook.PivotCaches(1)
' Create a new pivot table (shares cache).
Set pt = pc.CreatePivotTable(Worksheets.Add( ).[a3], "NewPivotTable")
' Select the pivot table.
pt.TableRange2.Select
End SubBecome an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access