PivotSelect Method

Microsoft Excel Visual Basic

expression.PivotSelect(Name, Mode, UseStandardName)

expression    Required. An expression that returns one of the objects in the Applies To list.

Name   Required String. The selection, in standard PivotTable report selection format.

Mode   Optional XlPTSelectionMode. Specifies the structured selection mode.

XlPTSelectionMode can be one of these XlPTSelectionMode constants.
xlBlanks
xlButton
xlDataAndLabel default
xlDataOnly
xlFirstRow
xlLabelOnly
xlOrigin

UseStandardName   Optional Variant. True for recorded macros that will play back in other locales.

Remarks

You can use the specified mode only to select the corresponding item in the PivotTable report. For example, you cannot select data and labels by using xlButton mode; likewise, you cannot select buttons by using xlDataOnly mode.

Example

This example selects all date labels in the first PivotTable report on worksheet one.

Worksheets(1).PivotTables(1).PivotSelect "date[All]", xlLabelOnly