PivotTable Object
TOC
Collapse the table of content
Expand the table of content

PivotTable Object (Excel)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Represents a PivotTable report on a worksheet.

The PivotTable object is a member of the PivotTables collection. The PivotTables collection contains all the PivotTable objects on a single worksheet.

Because PivotTable report programming can be complex, it’s generally easiest to record PivotTable report actions and then revise the recorded code.

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

Worksheets("Sheet3").PivotTables(1) _ 
 .PivotFields("Year").Orientation = xlRowField
Show:
© 2016 Microsoft