AutoSort Method

         Example         Applies To

Establishes automatic field-sorting rules for PivotTable reports.

Syntax

expression.AutoSort(Order, Field)

expression   Required. An expression that returns a PivotField object.

Order   Required Long. The sort order. Can be either of the following XlSortOrder constants: xlAscending or xlDescending. Can also be xlManual to disable automatic sorting.

Field   Required String. The name of the sort key field. You must specify the unique name (as returned from the SourceName property), and not the displayed name.