返回或设置对应于项目列表的字符串数组,该项目列表包含于数据透视表的多项目页字段中。
Variant 类型,可读写。
语法
表达式.CurrentPageList
表达式 一个代表 PivotField 对象的变量。
说明
为了避免运行时错误,数据源必须是 OLAP 源,选择的字段当前必须位于页面位置中,并且 EnableMultiplePageItems
属性必须设置为 True。
示例
本示例设置页字段以列出数据透视表的“Food”项目。本示例假定数据透视表位于活动工作表上。
示例代码 |
function UseCurrentPageList(){
let pvtTable = ActiveSheet.PivotTables(1)
let 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]"
}
|