PivotItems Collection Object

Description

A collection of all the PivotItem objects in a pivot field. The items are the individual data entries in a field category.

Accessors

Use the PivotItems method with an argument to access a single member of the collection or without an argument to access the entire collection at once. The following example creates an enumerated list of pivot field names and the items contained in those fields. It uses the Count method on the PivotItems collection to set up the item-enumeration loop.


Worksheets("sheet4").Activate
With Worksheets("sheet3").PivotTables(1)
    c = 1
    For i = 1 To .PivotFields.Count
        r = 1
        Cells(r, c) = .PivotFields(i).Name
        r = r + 1
        For x = 1 To .PivotFields(i).PivotItems.Count
            Cells(r, c) = .PivotFields(i).PivotItems(x).Name
            r = r + 1
        Next
        c = c + 1
    Next
End With

Properties

Application Property, Count Property, Creator Property, Parent Property.

Methods

Item Method.