Class SortField (Excel VBA)

The SortField object contains all the sort information for the Worksheet, ListObject, and AutoFilter objects.


Dim srtfld as SortField
Set srtfld = ActiveSheet.Sort.SortFields(Index:=1)

For Each

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

Methods

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.

Properties

CustomOrder specifies a custom order to sort the fields.

DataOption specifies how to sort text in the range specified in a SortField object.

Key specifies the range that is currently being sorted on.

Order determines the sort order for the values specified in the key.

Priority specifies the priority for the sort field.

SortOn returns or sets the attribute of the cell to sort on.

SortOnValue returns the value on which the sort is performed for the specified SortField object.

SubField

Range - Represents a cell, a row, a column, a selection of cells containing one or more contiguous blocks of cells, or a 3D range.