Skip to content

Latest commit

 

History

History
46 lines (29 loc) · 1.24 KB

Excel.PivotCell.ColumnItems.md

File metadata and controls

46 lines (29 loc) · 1.24 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
PivotCell.ColumnItems property (Excel)
vbaxl10.chm692079
vbaxl10.chm692079
Excel.PivotCell.ColumnItems
66936e2f-740e-e3de-5d20-47885bee9691
05/04/2019
medium

PivotCell.ColumnItems property (Excel)

Returns a PivotItemList collection that corresponds to the items on the column axis that represent the selected range.

Syntax

expression.ColumnItems

expression A variable that represents a PivotCell object.

Example

This example determines if the data item in cell B5 is under the Inventory item in the first column field, and notifies the user. The example assumes that a PivotTable exists on the active worksheet and that column B contains a column field of the PivotTable.

Sub CheckColumnItems() 
 
 ' Determine if there is a match between the item and column field. 
 If Application.Range("B5").PivotCell.ColumnItems.Item(1) = "Inventory" Then 
 MsgBox "Item in B5 is a member of the 'Inventory' column field." 
 Else 
 MsgBox "Item in B5 is not a member of the 'Inventory' column field." 
 End If 
 
End Sub

[!includeSupport and feedback]