PivotValueCell.PivotCell property (Excel)

Returns the PivotCell object that specifies the location of the PivotValueCell. Read-only.

Syntax

expression.PivotCell

expression A variable that represents a PivotValueCell object.

Property value

PIVOTCELL

Example

The following code sample uses the PivotCell property to get the Multi-dimensional Expressions (MDX) expression for the specified cell.

Sub GetMDX()
   'Get the MDX query for a particular PivotCell in a workbook level PivotTable
   MsgBox "The MDX for the PivotCell 1, 1: " & _
   ThisWorkbook.PivotTables(1).PivotValueCell(1, 1).PivotCell.MDX
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.