PivotCell.RowItems 属性 (Excel)
返回一个 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 支持和反馈,获取有关如何接收支持和提供反馈的指南。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈