主题
Item (方法)
根据 PivotLines 集合对象特定元素在集合中的位置返回该特定元素。只读。
参数
属性 | 数据类型 | 必填 | 说明 |
---|---|---|---|
Index | Any | 必填 | 指定集合的元素的位置。 |
示例
python
#本示例显示活动工作表上数据透视表中列轴上第二条数据透视线的PivotLineCells属性第一个PivotCell对应数据透视表项的值
def test():
pvtLine = ActiveSheet.Range("I1").PivotTable.PivotColumnAxis.PivotLines.Item(2)
print(pvtLine.PivotLineCells.Item(1).PivotItem.Value)
python
#本示例显示活动工作表上数据透视表中行轴上第一条数据透视线的类型是否为“xlPivotLineRegular”
def test():
pvtLine = ActiveSheet.Range("I1").PivotTable.PivotRowAxis.PivotLines.Item(1)
print(pvtLine.LineType == xlPivotLineRegular)