Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

PivotTable Object [Excel 2003 VBA Language Reference]

Office 2003
Multiple objects
PivotTable
Multiple objects

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.

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 the first PivotTable report on Sheet3.

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

Remarks

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



Properties | Application Property | CacheIndex Property | CalculatedMembers Property | ColumnFields Property | ColumnGrand Property | ColumnRange Property | Creator Property | CubeFields Property | DataBodyRange Property | DataFields Property | DataLabelRange Property | DataPivotField Property | DisplayEmptyColumn Property | DisplayEmptyRow Property | DisplayErrorString Property | DisplayImmediateItems Property | DisplayNullString Property | EnableDataValueEditing Property | EnableDrilldown Property | EnableFieldDialog Property | EnableFieldList Property | EnableWizard Property | ErrorString Property | GrandTotalName Property | HasAutoFormat Property | HiddenFields Property | InnerDetail Property | ManualUpdate Property | MDX Property | MergeLabels Property | Name Property | NullString Property | PageFieldOrder Property | PageFields Property | PageFieldStyle Property | PageFieldWrapCount Property | PageRange Property | PageRangeCells Property | Parent Property | PivotFormulas Property | PivotSelection Property | PivotSelectionStandard Property | PreserveFormatting Property | PrintTitles Property | RefreshDate Property | RefreshName Property | RepeatItemsOnEachPrintedPage Property | RowFields Property | RowGrand Property | RowRange Property | SaveData Property | SelectionMode Property | ShowCellBackgroundFromOLAP Property | ShowPageMultipleItemLabel Property | SmallGrid Property | SourceData Property | SubtotalHiddenPageItems Property | TableRange1 Property | TableRange2 Property | TableStyle Property | Tag Property | TotalsAnnotation Property | VacatedStyle Property | Value Property | Version Property | ViewCalculatedMembers Property | VisibleFields Property | VisualTotals Property

Methods | AddDataField Method | AddFields Method | CalculatedFields Method | CreateCubeFile Method | Format Method | GetData Method | GetPivotData Method | ListFormulas Method | PivotCache Method | PivotFields Method | PivotSelect Method | PivotTableWizard Method | RefreshTable Method | ShowPages Method | Update Method



Show:
© 2015 Microsoft