SortFields object (Excel)

The SortFields collection is a collection of SortField objects. It allows developers to store a sort state on workbooks, lists, and autofilters.

Remarks

The object contains properties to add, count, sort, and remove SortField objects.

Example

ActiveWorksheet.SortFields.Add Key:=Range("A1"), Order:=xlDescending 
ActiveWorksheet.SortFields.Add Key:=Range("B1"), Order:=xlDescending 
ActiveWorksheet.SortFields.Sort Header:=xlGuess 

Methods

Properties

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.