PivotTable Object

Description

Represents a PivotTable 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.

Using the PivotTable Object

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 PivotTable one on Sheet3.

Worksheets("Sheet3").PivotTables(1) _
    .PivotFields("Year").Orientation = xlRowField
Remarks

Because PivotTable programming can be complex, it's generally easiest to record PivotTable actions and then revise the recorded code. To record a macro, point to Macro on the Tools menu and click Record New Macro.

Properties

Application property, CacheIndex property, ColumnFields property, ColumnGrand property, ColumnRange property, Creator property, DataBodyRange property, DataFields property, DataLabelRange property, DisplayErrorString property, DisplayNullString property, EnableDrilldown property, EnableFieldDialog property, EnableWizard property, ErrorString property, HasAutoFormat property, HiddenFields property, InnerDetail property, ManualUpdate property, MergeLabels property, Name property, NullString property, PageFieldOrder property, PageFields property, PageFieldStyle property, PageFieldWrapCount property, PageRange property, PageRangeCells property, Parent property, PivotSelection property, PreserveFormatting property, RefreshDate property, RefreshName property, RowFields property, RowGrand property, RowRange property, SaveData property, SelectionMode property, SourceData property, SubtotalHiddenPageItems property, TableRange1 property, TableRange2 property, TableStyle property, Tag property, VacatedStyle property, Value property, VisibleFields property.

Methods

AddFields method, CalculatedFields method, GetData method, ListFormulas method, PivotCache method, PivotFields method, PivotFormulas method, PivotSelect method, PivotTableWizard method, RefreshTable method, ShowPages method, Update method.