Sort Method

See Also         Example         Applies To

Sorts the specified range.

Syntax

expression.Sort(ColumnKey, Order, YesNoGuessHeader)

expression   An expression that returns a Range object. If the range contains only one cell, the current region is sorted.

ColumnKey   Optional Long. The number of the first sort column. The default value is 1.

Order   Optional SheetSortOrderEnum. The sort order. The default value is ssAscending.

YesNoGuessHeader   Optional SheetYesNoGuessEnum constant. Use ssYes if the first row contains headers, ssNo if the first row does not contain headers, or ssGuess to have the method determine whether the first row contains headers or not. The default value is ssNo.