Skip to content
本页内容

Name (属性)

此属性提供选项可指定引用筛选。索引值可能发生更改,因此不能依赖于这些值获得准确的引用。

示例

python
#本示例显示活动工作表中第一个数据透视表的字段“name”的第一个筛选器的名称
def test():
    pvtFilter = ActiveSheet.PivotTables(1).PivotFields("name").PivotFilters.Item(1)
    print(pvtFilter.Name)
python
#本示例显示活动工作表中数据透视表的字段“id”的第二个筛选器的名称
def test():
    pvtFilter = ActiveSheet.Range("I1").PivotTable.PivotFields("id").PivotFilters.Item(2)
    print(f"筛选器的名称:{pvtFilter.Name}")