次の方法で共有


PivotField.Function Property (Excel)

Returns or sets the function used to summarize the PivotTable field (data fields only). Read/write XlConsolidationFunction.

Syntax

expression .Function

expression A variable that represents a PivotField object.

Remarks

For OLAP data sources, this property is read-only and always returns xlUnknown. For other data sources, this property cannot be set to xlUnknown.

Example

This example sets the Sum of 1994 field in the first PivotTable report on the active sheet to use the SUM function.

ActiveSheet.PivotTables("PivotTable1") _ 
 .PivotFields("Sum of 1994").Function = xlSum

See Also

Concepts

PivotField Object Members

PivotField Object