The PivotItem Object
A PivotItem is a unique value of a PivotField. To illustrate, consider the following code:
Dim pi As PivotItem For Each pi In
ActiveSheet.PivotTables("Sales&Trans"). PivotFields("Store City").PivotItems Debug.Print pi.Name
Next
That code will print the list:
BOSTON LOS ANGELES NEW YORK
which contains the distinct Store City values from the Store City pivot field.
The PivotItems method of the PivotField object returns PivotItem objects. The syntax:
PivotFieldObject .PivotItems returns the collection of all PivotItem objects for that PivotField. The syntax:
PivotFieldObject .PivotItems( Index)
can return a single PivotItem object or an array of PivotItem objects (by setting Index to an array of indexes).
Table 20-5 shows the properties and methods of the PivotItem object. Let us take a look at some of these members. Note that several of the members of the PivotField object also apply to the PivotItem object.
|
Application |
IsCalculated |
Position |
|
ChildItems |
LabelRange |
RecordCount |
|
Creator |
Name |
ShowDetail |
|
DataRange |
Parent |
SourceName |
|
Delete |
ParentItem |
Value |
|
Formula |
ParentShowDetail |
Visible |
Post a comment