Skip to content

Latest commit

 

History

History
55 lines (32 loc) · 1.33 KB

Excel.SlicerPivotTables.AddPivotTable.md

File metadata and controls

55 lines (32 loc) · 1.33 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
SlicerPivotTables.AddPivotTable method (Excel)
vbaxl10.chm911077
vbaxl10.chm911077
Excel.SlicerPivotTables.AddPivotTable
c5fc95c6-0fb9-1c8f-5b12-8a4c0f9f10c7
05/16/2019
medium

SlicerPivotTables.AddPivotTable method (Excel)

Adds a reference to a PivotTable to the SlicerPivotTables collection.

Syntax

expression.AddPivotTable (PivotTable)

expression A variable that represents a SlicerPivotTables object.

Parameters

Name Required/Optional Data type Description
PivotTable Required PivotTable A PivotTable object that represents the PivotTable to add.

Return value

Nothing

Remarks

When a PivotTable is added to the SlicerPivotTables collection, it can be filtered by its parent SlicerCache and the slicers associated with it.

Example

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]