Excel) (PivotValueCell 物件
提供一種方式,在無法使用 Range 物件 ( 實際儲存格) 時,公開儲存格的值。
範例
此程式碼範例會使用 PivotValueCell 屬性來測試樞紐分析表中某個儲存格的值是否大於另一個儲存格。
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
方法
屬性
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。