返回与类别轴上表示所选单元格的项目对应的 PivotItemList 集合。
语法
表达式。RowItems
表达式 表示 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
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。