Pivot ItemList Object

Represents a list of Pivotltems associated with a particular cell in a PivotTable. You access the list through the PivotCell object. PivotItemLists are accessed either through the ColumnItems or RowItems properties of the PivotCell object. How many row and column items there are in the PivotItemList depend on the structure of the PivotTable.

For example, cell D5 is in a PivotTable called WroxSalesl. In the row area to the left of cell D5 is the row heading OR (Oregon). To the left of OR is another row label called Region1. Based on this information, the following will yield 2:

MsgBox wksPivotTable.Range("D5").PivotCell.RowItems.Count

The following will yield Region1, the farthest label to the left of cell D5:

MsgBox wksPivotTable.Range("D5").PivotCell.RowItems(1)

Finally, the following will yield OR, the second farthest label to the left of cell D5:

MsgBox wksPivotTable.Range("D5").PivotCell.RowItems(2)

A use for both the PivotItemList and PivotCell objects has yet to be found. Normally, you are looking for the opposite. You want to retrieve information based on row or column items (headings) you provide, something the GetPivotData method and the GETPIVOTDATA worksheet function can obtain.

0 0

Post a comment