Class PivotCell (Excel VBA)

The class PivotCell represents a cell in a PivotTable report.

Set

To use a PivotCell class variable it first needs to be instantiated, for example

Dim pvtlcel as PivotCell
Set pvtlcel = ActiveCell.PivotCell

The following procedures can be used to set variables of type PivotCell: PivotLineCells.Item, PivotValueCell.PivotCell, Range.PivotCell, ValueChange.PivotCell, PivotLine.PivotLineCells and PivotLine.PivotLineCellsFull

For Each

Here is an example of processing the PivotCell items in a collection.

Dim pvtlcelPivotLineCell As PivotCell
For Each pvtlcelPivotLineCell In Application.PivotLineCells
	
Next pvtlcelPivotLineCell

Themes

Some procedures in this class have been grouped together in themes and are described on separate theme pages

Cell with its procedures CellChanged and PivotCellType
Column with its procedures ColumnItems and PivotColumnLine
Row with its procedures PivotRowLine and RowItems

Methods

Other Methods

AllocateChange - Performs a writeback operation on the specified cell in a PivotTable report based on an OLAP data source.

DiscardChange - Discards changes to the specified cell in a PivotTable report.

Properties

CustomSubtotalFunction returns the custom subtotal function field setting of a PivotCell object.

DataField returns a PivotField object that corresponds to the selected data field.

DataSourceValue returns the value last retrieved from the data source for edited cells in a PivotTable report.

MDX returns a tuple that provides the full MDX coordinates of the specified value cell in a PivotTable with an OLAP data source.

Parent returns the parent object for the specified object. Read-only.

PivotField returns a PivotField object that represents the PivotTable field containing the upper-left corner of the specified range.

PivotItem returns a PivotItem object that represents the PivotTable item containing the upper-left corner of the specified range.

PivotTable returns a PivotTable object that represents the PivotTable report associated with the PivotCell.

Range returns a Range object that represents the range that the specified PivotCell applies to.

ServerActions represents a collection of actions consisting of OLAP-defined actions that can be executed. The actions are specific to PivotTables existing at a worksheet-level.

PivotLineCells.Count returns the number of items in the PivotLineCells collection.

PivotLineCells.Full when True, all of the PivotLineCells in the PivotLine (including those that are hidden in compact form) are retrieved.

PivotLineCells.Item returns a specific element of the PivotLineCells collection object by its position in the collection.

PivotLineCells.Parent returns the parent object for the specified PivotLineCells object. Read-only.