PivotCell.ColumnItems プロパティ (Excel)

選択した範囲を表す列軸の項目に対応する PivotItemList コレクションを返します。

構文

ColumnItems

PivotCell オブジェクトを表す変数。

次の使用例は、セル B5 のデータ項目が最初の列フィールドのインベントリ項目の下にあるかどうかを判断し、ユーザーに通知します。 次の使用例では、アクティブ ワークシートにピボットテーブルがあり、ワークシートの列 B にピボットテーブルの列フィールドが含まれるものとします。

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

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。