PivotCell Object
Excel Developer Reference |
Represents a cell in a PivotTable report.
Remarks
Use the PivotCell property of the Range collection to return a PivotCell object.
Once a PivotCell object is returned, you can use the ColumnItems or RowItems property to determine the PivotItems collection that corresponds to the items on the column or row axis that represents the selected number. The following example uses the ColumnItems property of the PivotCell object to return a PivotItemList collection.
Example
Once a PivotCell object is returned, you can use the PivotCellType property to determine what type of cell a particular range is. The following example determines if cell A5 in the PivotTable is a data item and notifies the user. This example assumes that a PivotTable exists on the active worksheet and that cell A5 is contained in the PivotTable. If cell A5 is not in the PivotTable, the example handles the run-time error.
Visual Basic for Applications |
---|
|
This example determines the column field that the data item of cell B5 is in. It then determines if the column field title matches "Inventory" and notifies the user. The example assumes that a PivotTable exists on the active worksheet and that column B of the worksheet contains a column field of the PivotTable.
Visual Basic for Applications |
---|
|
See Also