Skip to content
本页内容

Item (方法)

根据 PivotFilters 集合对象特定元素在集合中的位置返回该特定元素。只读。

参数

属性数据类型必填说明
IndexAny必填指定集合的元素的位置。

示例

python
#本示例显示工作表 Sheet1 中数据透视表字段“score”的第一个筛选器应用的筛选器类型是否为“xlCaptionIsGreaterThan”
def test():
    pvtFilter = Worksheets.Item("Sheet1").Range("I1").PivotTable.PivotFields("score").PivotFilters.Item(1)
    print(pvtFilter.FilterType == xlCaptionIsGreaterThan)
python
#本示例显示第一张工作表中数据透视表的字段“id”的第一个筛选器的参数
def test():
    pvtField = Worksheets.Item(1).Range("I1").PivotTable.PivotFields("id")
    print(pvtField.PivotFilters.Item(1).Value1)