多个对象![]() ![]() ![]() |
表示数据透视表中的一个字段。PivotField 对象是 PivotFields 集合的成员。PivotFields 集合包含数据透视表中所有的字段,也包括隐藏字段。
使用 PivotFields(index) 返回单个 PivotField 对象,其中,index 为字段名称或编号。下例使 Sheet3 上第一张数据透视表中的字段“Year”成为行字段。
Worksheets("sheet3").PivotTables(1) _
.PivotFields("year").Orientation = xlRowField
下列属性返回数据透视表字段的子集,在某些情况下,使用这些属性会更为方便: