PivotField.EnableItemSelection property (Excel)

When set to False, disables the ability to use the field dropdown in the user interface. The default value is True. Read/write Boolean.

Syntax

expression.EnableItemSelection

expression A variable that represents a PivotField object.

Remarks

A run-time error occurs if the OLAP PivotTable field is not the highest level for the hierarchy.

Example

This example determines the setting for selecting items by using the field dropdown and enables the feature, if necessary. The example assumes that a PivotTable exists on the active worksheet.

Sub UseEnableItemSelection() 
 
 Dim pvtTable As PivotTable 
 Dim pvtField As PivotField 
 
 Set pvtTable = ActiveSheet.PivotTables(1) 
 Set pvtField = pvtTable.RowFields(1) 
 
 ' Determine setting for property and enable if necessary. 
 If pvtField.EnableItemSelection = False Then 
 pvtField.EnableItemSelection = True 
 MsgBox "Item selection enabled for fields." 
 Else 
 MsgBox "Item selection is already enabled for fields." 
 End If 
 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.