title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
SortFields object (Excel) |
vbaxl10.chm844072 |
|
|
a9c83ea1-1cd9-1552-1f03-71bd92a2cc72 |
04/02/2019 |
medium |
The SortFields collection is a collection of SortField objects. It allows developers to store a sort state on workbooks, lists, and autofilters.
The object contains properties to add, count, sort, and remove SortField objects.
ActiveWorksheet.SortFields.Add Key:=Range("A1"), Order:=xlDescending
ActiveWorksheet.SortFields.Add Key:=Range("B1"), Order:=xlDescending
ActiveWorksheet.SortFields.Sort Header:=xlGuess
[!includeSupport and feedback]