PivotField Object [Excel 2003 VBA Language Reference]

Multiple objects
PivotField
Multiple objects

Represents a field in a PivotTable report. The PivotField object is a member of the PivotFields collection. The PivotFields collection contains all the fields in a PivotTable report, including hidden fields.

Using the PivotField Object

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

Worksheets("sheet3").PivotTables(1) _
    .PivotFields("year").Orientation = xlRowField

In some cases, it may be easier to use one of the properties that returns a subset of the PivotTable fields. The following properties are available:

Properties | Application Property | AutoShowCount Property | AutoShowField Property | AutoShowRange Property | AutoShowType Property | AutoSortField Property | AutoSortOrder Property | BaseField Property | BaseItem Property | Calculation Property | Caption Property | ChildField Property | ChildItems Property | Creator Property | CubeField Property | CurrentPage Property | CurrentPageList Property | CurrentPageName Property | DatabaseSort Property | DataRange Property | DataType Property | DragToColumn Property | DragToData Property | DragToHide Property | DragToPage Property | DragToRow Property | DrilledDown Property | EnableItemSelection Property | Formula Property | Function Property | GroupLevel Property | HiddenItems Property | HiddenItemsList Property | IsCalculated Property | IsMemberProperty Property | LabelRange Property | LayoutBlankLine Property | LayoutForm Property | LayoutPageBreak Property | LayoutSubtotalLocation Property | MemoryUsed Property | Name Property | NumberFormat Property | Orientation Property | Parent Property | ParentField Property | ParentItems Property | Position Property | PropertyOrder Property | PropertyParentField Property | ServerBased Property | ShowAllItems Property | SourceName Property | StandardFormula Property | SubtotalName Property | Subtotals Property | TotalLevels Property | Value Property | VisibleItems Property

Methods | AddPageItem Method | AutoShow Method | AutoSort Method | CalculatedItems Method | Delete Method | PivotItems Method

Parent Objects | PivotCell Object | PivotField Object | PivotItem Object | PivotItems Collection | PivotTable Object | Range Collection

Child Objects | CubeField Object | PivotField Object | Range Object

See Also | PivotCache Object | PivotCell Object | PivotFormula Object | PivotItem Object | PivotItemList Collection | PivotLayout Object | PivotTable Object