Class SortField (Excel VBA)
The SortField object contains all the sort information for the Worksheet, ListObject, and AutoFilter objects.
To use a SortField class variable it first needs to be instantiated, for example
Dim srtfld as SortField Set srtfld = ActiveSheet.Sort.SortFields(Index:=1)
Here is an example of processing the SortField items in a collection.
Dim srtfld As SortField For Each srtfld In ActiveSheet.Sort.SortFields Next srtfld
Some procedures in this class have been grouped together in themes and are described on separate theme pages
These are the main methods of the SortField class
Delete - Removes the specified SortField object from the SortFields collection.
ModifyKey - Modify the key value by which values are sorted in the field.
SetIcon - Sets an icon for a SortField object.
SortFields.Clear - Clears all the SortFields objects.
DataOption specifies how to sort text in the range specified in a SortField object.
Key specifies the range that is currently being sorted on.
Parent returns the parent object for the specified object. Read-only.
Priority specifies the priority for the sort field.
SortOnValue returns the value on which the sort is performed for the specified SortField object.
SortFields.Count returns the number of objects in the collection.
SortFields.Item returns a SortField object that represents a collection of items that can be sorted in a workbook.
SortFields.Parent returns the parent object for the specified object. Read-only.