PivotCell.RowItems Property (Excel)

Office 2013 and later

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Returns a PivotItemList collection that corresponds to the items on the category axis that represent the selected cell.

expression .RowItems

expression A variable that represents a PivotCell object.

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

Sub CheckRowItems() 
 ' Determine if there is a match between the item and row field. 
 If Application.Range("B5").PivotCell.RowItems.Item(1) = "Inventory" Then 
 MsgBox "Cell B5 is a member of the 'Inventory' row field. 
 MsgBox "Cell B5 is not a member of the 'Inventory' row field. 
 End If 
End Sub