Skip to content
本页内容

CurrentPage (属性)

返回或设置页字段的当前页显示(仅对页字段有效)。PivotItem 类型,可读写。

示例

python
#本示例将 Sheet1 上数据透视表中字段“id”的当前页名称返回到字符串变量 `strPgName` 中并显示
def test():
    pvtTable = Worksheets.Item("Sheet1").Range("I2").PivotTable
    strPgName = pvtTable.PivotFields("id").CurrentPage
    print(strPgName)
python
#本示例将活动工作表第一张数据透视表的页字段“id”显示的当前页设置为“5”
def test():
    ActiveSheet.PivotTables(1).PivotFields("id").CurrentPage = "5"