Skip to content

Latest commit

 

History

History
48 lines (33 loc) · 1.01 KB

Excel.PivotField.AutoSortField.md

File metadata and controls

48 lines (33 loc) · 1.01 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
PivotField.AutoSortField property (Excel)
vbaxl10.chm240114
vbaxl10.chm240114
Excel.PivotField.AutoSortField
f31499e6-dea7-5e54-2316-9088bd5670b3
05/04/2019
medium

PivotField.AutoSortField property (Excel)

Returns the name of the data field used to sort the specified PivotTable field automatically. Read-only String.

Syntax

expression.AutoSortField

expression A variable that represents a PivotField object.

Example

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]