title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
SlicerPivotTables.AddPivotTable method (Excel) |
vbaxl10.chm911077 |
|
|
c5fc95c6-0fb9-1c8f-5b12-8a4c0f9f10c7 |
05/16/2019 |
medium |
Adds a reference to a PivotTable to the SlicerPivotTables collection.
expression.AddPivotTable (PivotTable)
expression A variable that represents a SlicerPivotTables object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
PivotTable | Required | PivotTable | A PivotTable object that represents the PivotTable to add. |
Nothing
When a PivotTable is added to the SlicerPivotTables collection, it can be filtered by its parent SlicerCache and the slicers associated with it.
The following code example adds PivotTable1 to the slicer cache associated with the Customer slicer.
Dim pvts As SlicerPivotTables
Set pvts = ActiveWorkbook.SlicerCaches("Slicer_Customer").PivotTables
pvts.AddPivotTable(ActiveSheet.PivotTables("PivotTable1"))
[!includeSupport and feedback]