返回或设置对数据透视表字段汇总时所使用的函数(仅用于数据字段)。XlConsolidationFunction 类型,可读写。
XlConsolidationFunction 可为以下 these XlConsolidationFunction 常量之一。 |
xlAverage |
xlCountNums |
xlMin |
xlStDev |
xlSum |
xlVar |
xlCount |
xlMax |
xlProduct |
xlStDevP |
xlUnknown |
xlVarP |
expression.Function
expression 必需。该表达式返回“应用于”列表中的对象之一。
对于 OLAP 数据源,本属性是只读的,并且总是返回 xlUnknown。对于其他的数据源,本属性不能被设置为 xlUnknown。
本示例对当前活动工作表中第一个数据透视表的“Sum of 1994”字段进行设置,使之使用“SUM”函数。
ActiveSheet.PivotTables("PivotTable1") _
.PivotFields("Sum of 1994").Function = xlSum