Remarks

The PivotField object is a member of the collection. The PivotFields collection contains all the fields in a PivotTable report, including hidden fields.

In some cases, it may be easier to use one of the properties that returns a subset of the PivotTable fields. The following properties are available:

Example

Use (), where is the field name or index number, to return a single PivotFieldobject. The following example makes the Year field a row field in the first PivotTable report on Sheet3.

Visual Basic for Applications
Worksheets("sheet3").PivotTables(1) _ .PivotFields("year").Orientation = xlRowField
Pivot Field Object PivotField PivotField Object

See also:

index index