Skip to content

Latest commit

 

History

History
56 lines (35 loc) · 1.27 KB

Excel.pivotvaluecell.value.md

File metadata and controls

56 lines (35 loc) · 1.27 KB
title keywords f1_keywords ms.assetid ms.date ms.localizationpriority
PivotValueCell.Value property (Excel)
vbaxl10.chm918074
vbaxl10.chm918074
47bebd10-cd02-680f-f158-39c199e8ecf2
05/07/2019
medium

PivotValueCell.Value property (Excel)

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.

Syntax

expression.Value

expression A variable that represents a PivotValueCell object.

Remarks

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

Property value

VARIANT

Example

This code sample uses the PivotValueCell property to test whether the value of one cell in a PivotTable is greater than another cell.

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

[!includeSupport and feedback]