title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
PivotField.AutoSortField property (Excel) |
vbaxl10.chm240114 |
|
|
f31499e6-dea7-5e54-2316-9088bd5670b3 |
05/04/2019 |
medium |
Returns the name of the data field used to sort the specified PivotTable field automatically. Read-only String.
expression.AutoSortField
expression A variable that represents a PivotField object.
This example displays a message box showing the AutoSort parameters for the Product field.
With Worksheets(1).PivotTables(1).PivotFields("product")
Select Case .AutoSortOrder
Case xlManual
aso = "manual"
Case xlAscending
aso = "ascending"
Case xlDescending
aso = "descending"
End Select
MsgBox " sorted in " & aso & _
" order by " & .AutoSortField
End With
[!includeSupport and feedback]