PivotField Object
Description
Represents a field in a PivotTable. The PivotField object is a member of the PivotFields collection. The PivotFields collection contains all the fields objects in a PivotTable, including hidden fields.
Using the PivotField Object
Use PivotFields(index), where index is the pivot-field name or index number, to return a single PivotField object. The following example makes the Year field a row field in PivotTable one 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:
- ColumnFields property
- DataFields property
- HiddenFields property
- PageFields property
- RowFields property
- VisibleFields property
Properties
Application property, AutoShowCount property, AutoShowField property, AutoShowRange property, AutoShowType property, AutoSortField property, AutoSortOrder property, BaseField property, BaseItem property, Calculation property, ChildField property, ChildItems property, Creator property, CurrentPage property, DataRange property, DataType property, DragToColumn property, DragToHide property, DragToPage property, DragToRow property, Formula property, Function property, GroupLevel property, HiddenItems property, IsCalculated property, LabelRange property, MemoryUsed property, Name property, NumberFormat property, Orientation property, Parent property, ParentField property, ParentItems property, Position property, ServerBased property, ShowAllItems property, SourceName property, TotalLevels property, Value property, VisibleItems property.
Methods
AutoShow method, AutoSort method, CalculatedItems method, Delete method, PivotItems method, Subtotals method.