PivotField Object

Description

Represents a field in a pivot table.

Accessors

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

To access a single member of the collection, use the PivotFields method with the index number or name of the pivot field as an argument.

Use the Name property to set or return the pivot field name. The following example makes the field named "year" a row field.


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

In some cases, it may be easier to use one of the methods that returns a subset of the PivotTable fields. The following accessor methods are available: ColumnFields method, DataFields method, HiddenFields method, PageFields method, RowFields method, VisibleFields method.

Properties

Application Property, BaseField Property, BaseItem Property, Calculation Property, ChildField Property, Creator Property, CurrentPage Property, DataRange Property, DataType Property, Function Property, GroupLevel Property, LabelRange Property, Name Property, NumberFormat Property, Orientation Property, Parent Property, ParentField Property, Position Property, SourceName Property, Subtotals Property, TotalLevels Property, Value Property.

Methods

ChildItems Method, HiddenItems Method, ParentItems Method, PivotItems Method, VisibleItems Method.