Examining the recorded code for the pivot table

VBA code that works with pivot tables can be confusing. To make any sense of the recorded macro, you need to know about a few relevant objects, all of which are explained in the Help system.

■ PivotCaches: A collection of PivotCache objects in a Workbook object (the data used by a pivot table is stored in a pivot cache).

■ PivotTables: A collection of PivotTable objects in a Worksheet object.

■ PivotFields: A collection of fields in a PivotTable object.

■ PivotItems: A collection of individual data items within a field category.

■ CreatePivotTable: A method that creates a pivot table by using the data in a pivot cache.

■ AddDataField: A method that adds a field to the Value area.

0 0

Post a comment