

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback. PivotFields("Year").Orientation = xlRowField By choosing Add to Data Model, this table is.

The following example makes the field named Year a row field in the first PivotTable report on Sheet3. To demonstrate this functionality, I created a small reference table in which I assigned each Category to a Type. Use PivotTables ( index), where index is the PivotTable index number or name, to return a single PivotTable object. The PivotTables collection contains all the PivotTable objects on a single worksheet.īecause PivotTable report programming can be complex, it's generally easiest to record PivotTable report actions and then revise the recorded code.

The PivotTable object is a member of the PivotTables collection. INSERTING A PIVOT TABLE Click anywhere your data source or Table and choose Insert > PivotTable Alt N V T Alt F5 REFRESH A PIVOT TABLE Right click anywhere in the pivot table and select Refresh. Represents a PivotTable report on a worksheet.
