PivotTable.AddDataField (Excel)

Adds a data field to a PivotTable report. Returns a PivotField object that represents the new data field.

AddDataField (Field, Caption, Function)


Dim pvtfAddDataField As PivotField
Set pvtfAddDataField = ActiveCell.PivotTable.AddDataField(Field:=)

Arguments

The following argument is required

Field (Object) - The unique field on the server. If the source data is Online Analytical Processing (OLAP), the unique field is a cube field. If the source data is non-OLAP (non-OLAP source data), the unique field is a PivotTable field.

Optional arguments

The following arguments are optional

Caption (String) - The label used in the PivotTable report to identify this data field.

Function - The function performed in the added data field