Excel) (PivotCell.RowItems 屬性

會傳回 PivotItemList 集合,該集合會對應至代表所選儲存格之類別座標軸上的專案。

語法

運算式RowItems

表達 代表 PivotCell 物件的變數。

範例

本範例將判斷儲存格 B5 中的資料項目,是否位在第一個列欄位中的「庫存」項目下,並且通知使用者。 此範例假設活動工作表上有一個樞紐分析表,而工作表的欄 B 包含樞紐分析表的資料列專案。

Sub CheckRowItems() 
 
 ' Determine if there is a match between the item and row field. 
 If Application.Range("B5").PivotCell.RowItems.Item(1) = "Inventory" Then 
 MsgBox "Cell B5 is a member of the 'Inventory' row field. 
 Else 
 MsgBox "Cell B5 is not a member of the 'Inventory' row field. 
 End If 
 
End Sub

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應