Class PivotValueCell (Excel VBA)

Provides a way to expose values of cells in the case that actual cells (Range objects) are not available.

Parent

Returns an object that represents the parent object of the specified PivotValueCell object. Read-only.

PivotCell

Returns the PivotCell object that specifies the location of the PivotValueCell.

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

ServerActions

Returns a collection of OLAP Action name objects that represent OLAP-defined actions that can be executed.

A server action is an optional feature that an OLAP cube administrator can define on a server that uses a cube member or measure as a parameter into a query to obtain details in the cube, or to start another application.

ShowDetail

Puts the individual rows of an OLAP data source that contribute to an aggregate onto their own Excel worksheet.

Value

Returns the value at the location. The value is the value after ShowAs and other calculations have been applied. Variant can be Empty, Number, Date, String, or Error value.

This property works independently of whether the PivotTable is on a worksheet or not.

Sub TestEquality()
Dim X As Double
Dim Y As Double

'This code assumes that you have a Standalone PivotChart on one of the worksheets
X = ThisWorkbook.PivotTables(1).PivotValueCell(1, 1).Value
Y = ThisWorkbook.PivotTables(1).PivotValueCell(1, 2).Value

If X > Y Then
MsgBox "X is greater than Y"
Else
MsgBox "Y is greater than X"
End If
End Sub