PivotFields Object
A collection of all the PivotField objects in a PivotTable report.
Remarks
In some cases, it may be easier to use one of the properties that returns a subset of the PivotTable fields. The following accessor methods are available:
- ColumnFields property
- DataFields property
- HiddenFields property
- PageFields property
- RowFields property
- VisibleFields property
Example
Use the PivotFields method of the PivotTable object to return the PivotFields collection. The following example enumerates the field names in the first PivotTable report on Sheet3.
| Visual Basic for Applications |
|---|
|
Use PivotFields(), where is the field name or index number, to return a single PivotFieldobject. The following example makes the Year field a row field in the first PivotTable report on Sheet3.
| Visual Basic for Applications |
|---|
|
See also:
- Excel Object Model Reference
- PivotFields Object Members
- PivotCache Object
- PivotCell Object
- PivotField Object
- PivotFormula Object
- PivotItem Object
- PivotItemList Object
- PivotLayout Object
- PivotTable Object
| index | index |