Skip to content

Latest commit

 

History

History
50 lines (31 loc) · 1.23 KB

Excel.PivotTable.SelectionMode.md

File metadata and controls

50 lines (31 loc) · 1.23 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
PivotTable.SelectionMode property (Excel)
vbaxl10.chm235125
vbaxl10.chm235125
Excel.PivotTable.SelectionMode
692c31b9-01a4-2a49-65c9-66c14ab6aa7c
05/09/2019
medium

PivotTable.SelectionMode property (Excel)

Returns or sets the PivotTable report structured selection mode. Read/write XlPTSelectionMode.

Syntax

expression.SelectionMode

expression A variable that represents a PivotTable object.

Remarks

If the PivotTable field isn't in outline form, specifying the sum of any of the constants and xlFirstRow is equivalent to specifying the constant alone.

Example

This example enables structured selection mode, and then sets the first PivotTable report on worksheet one to allow only data to be selected.

Application.PivotTableSelection = True 
Worksheets(1).PivotTables(1).SelectionMode = xlDataOnly

In this example, the PivotTable report is in outline form.

Application.PivotTableSelection = True 
Worksheets(1).PivotTables(1).SelectionMode = _ 
 xlDataOnly + xlFirstRow

[!includeSupport and feedback]