Microsoft Office Tutorials and References
In Depth Information
Figure 20-25. Illustrating AutoSort
The Order parameter specifies the sort order and is one of the following constants:
Enum XlSortOrder
xlAscending = 1
xlDescending = 2
End Enum
It can also be set to xlManual to disable automatic sorting. The Field parameter is the name of
the field to use as the sort key.
For instance, referring to Figure 20-10 , the code:
ActiveSheet.PivotTables("Sales&Trans"). _
PivotFields("Store Type").AutoSort _
xlAscending, "Sale"
sorts by Sale and produces the results shown in Figure 20-25 . Note the order of the Store Type
items for Boston as compared to the other cities.
Figure 20-25. Illustrating AutoSort
The read-only AutoSortField property returns the name of the key field and the AutoSortOrder
property returns the sort order of the pivot field ( xlAscending , xlDescending , or
xlManual ).
20.7.3 The Fundamental Properties
The PivotField object has a handful of basic properties that you will almost always want to set. Function property
This property applies only to data fields and returns or sets the aggregate function used to
summarize the pivot field. It can be one of the following XlConsolidationFunction
Enum XlConsolidationFunction
Search JabSto ::

Custom Search