返回一个
PivotItemList
集合,该集合对应于表示选定区域的列轴上的项目。
语法
表达式.ColumnItems
表达式 一个代表 PivotCell 对象的变量。
示例
本示例判断单元格 B5 中的数据项是否在第一个列字段中的“Inventory”项目之下,并通知用户。本示例假定数据透视表位于活动工作表上,并且第 B 列包含数据透视表的列字段。
示例代码 |
function CheckColumnItems() {
// Determine if there is a match between the item and column field.
if(Application.Range("B5").PivotCell.ColumnItems.Item(1) == "Inventory") {
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.")
}
}
|