RowItems 属性

       

返回一个 PivotItemList 集合,该集合对应于分类轴上代表选定单元格的项目。

expression.RowItems

expression   必需。该表达式返回一个 PivotCell 对象。

示例

本示例判断单元格 B5 中的数据项是否在第一个行字段中的“Inventory”项之下,并通知用户。本示例假定数据透视表位于活动工作表上,并且工作表的列 B 包含数据透视表的行项目。

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.
    Else
        MsgBox "Cell B5 is not a member of the 'Inventory' row field.
    End If

End Sub