PIVOT.FIELD.PROPERTIES macro

Changes the properties of a field inside a PivotTable report.

Syntax

PIVOT.FIELD.PROPERTIES(name, pivot_field_name, new_name, orientation, function, formats)

PIVOT.FIELD.PROPERTIES?(name, pivot_field_name, new_name, orientation, function, formats)

Name    is the name of the PivotTable report containing the field which the user wants to edit. If name is omitted, Microsoft Excel will use the PivotTable report containing the active cell.

Pivot_field_name    is the name of a field in the PivotTable report which the user would like to edit, as text. If it is omitted, Microsoft Excel uses the field containing the active cell.

New_name    is the name which you would like to rename the current field. If it is omitted, the name of the current field will not change.

Orientation    is a number between 0 and 4 specifying which area will show the field containing the active cell. If zero, then the field is deleted and all other arguments to this function are ignored. If this argument is omitted, the orientation of the field will not change.

Value Orientation
0 Delete
1 Display as row
2 Display as column
3 Display as page
4 Display as data

Function    is a number between 0 and 4094 specifying which calculation or subtotals to apply to the field. If you will be showing the field in the header (orientation 1, 2, or 3), add up the values from the table corresponding to the subtotals you would like to show. If you will be showing the field as a data field (orientation 4), use one value from the table. If an entry in this column is left blank, Microsoft Excel will not change the calculation or subtotal which are currently attached to the field.

Value Function
0 NO SUBTOTALS
1 AUTOMATIC
2 SUM
4 COUNTA
8 COUNT
16 AVERAGE
32 MAX
64 MIN
128 PRODUCT
256 STDEV
512 STDEVP
1024 VAR
2048 VARP

Formats    is either a one- or a two- dimensional array, depending on whether the field is a header field or a data field.

Value Format
1 Normal
2 Difference From
3 %Of Item
4 %Difference From
5 Running Total In
6 %Of Row
7 %Of Column
8 %Of Subtotal
9 Index

 

 

Remarks

 

Related Functions

PIVOT.ADD.DATA   Adds a field to a PivotTable report as a data field

PIVOT.ADD.FIELDS   Adds fields to a PivotTable report

PIVOT.FIELD   Pivots fields within a PivotTable report

PIVOT.FIELD.GROUP   Creates groups within a PivotTable report

PIVOT.FIELD.UNGROUP   Ungroups all selected groups within a PivotTable report

PIVOT.ITEM   Moves an item within a PivotTable report

PIVOT.ITEM.PROPERTIES   Changes the properties of an item within a header field

PIVOT.REFRESH   Refreshes a PivotTable report

PIVOT.SHOW.PAGES   Creates new sheets in the workbook containing the active cell

PIVOT.TABLE.WIZARD   Creates an empty PivotTable report

Return to index