返回或设置对应于项目列表的字符串数组,该项目列表包含于数据透视表的多项目页字段中。 读/写 Variant。
语法
表达式。CurrentPageList
表达式 表示 PivotField 对象的变量。
备注
要避免运行时错误,数据源必须是 OLAP 源,所选字段当前必须位于“页面”位置,并且 EnableMultiplePageItems 属性必须设置为 True。
示例
此示例设置页面字段以列出数据透视表报表的“食品”项。 本示例假定数据透视表位于活动工作表上。
Sub UseCurrentPageList()
Dim pvtTable As PivotTable
Dim pvtField As PivotField
Set pvtTable = ActiveSheet.PivotTables(1)
Set pvtField = pvtTable.PivotFields("[Product]")
' To avoid run-time errors set the following property to True.
pvtTable.CubeFields("[Product]").EnableMultiplePageItems = True
' Set the page list to "Food".
pvtField.CurrentPageList = "[Product].[All Products].[Food]"
End Sub
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。