PivotField Object (Excel)
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

PivotField Object (Excel)

Office 2010

Represents a field in a PivotTable report.

The PivotField object is a member of the PivotFields 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:

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

Worksheets("sheet3").PivotTables(1) _ 
 .PivotFields("year").Orientation = xlRowField
© 2015 Microsoft