PivotCell.DataField (Excel)

Returns a PivotField object that corresponds to the selected data field.

This property returns an error if the PivotCell object is not one of the allowed constants of XlPivotCellType: xlPivotCellTypeDataField, xlPivotCellTypeSubtotal, or xlPivotCellTypeGrandTotal.


Dim pvtfDataField As PivotField
Set pvtfDataField = ActiveCell.PivotCell.DataField