[]
        
(Showing Draft Content)

GrapeCity.Spreadsheet.IRange.Sort

Sort Method

Sort(string, SortOrder, string, SortType, SortOrder, string, SortOrder, YesNoGuess, bool, SortMethod, SortDataOption, SortDataOption, SortDataOption)

Sorts a range of values.

Declaration
void Sort(string key1 = null, SortOrder order1 = SortOrder.Ascending, string key2 = null, SortType type = SortType.SortLabels, SortOrder order2 = SortOrder.Ascending, string key3 = null, SortOrder order3 = SortOrder.Ascending, YesNoGuess header = YesNoGuess.No, bool matchCase = false, SortMethod sortMethod = SortMethod.PinYin, SortDataOption dataOption1 = SortDataOption.Normal, SortDataOption dataOption2 = SortDataOption.Normal, SortDataOption dataOption3 = SortDataOption.Normal)
Sub Sort(Optional key1 As String = Nothing, Optional order1 As SortOrder = SortOrder.Ascending, Optional key2 As String = Nothing, Optional type As SortType = SortType.SortLabels, Optional order2 As SortOrder = SortOrder.Ascending, Optional key3 As String = Nothing, Optional order3 As SortOrder = SortOrder.Ascending, Optional header As YesNoGuess = YesNoGuess.No, Optional matchCase As Boolean = False, Optional sortMethod As SortMethod = SortMethod.PinYin, Optional dataOption1 As SortDataOption = SortDataOption.Normal, Optional dataOption2 As SortDataOption = SortDataOption.Normal, Optional dataOption3 As SortDataOption = SortDataOption.Normal)
Parameters
Type Name Description
string key1

Specifies the first sort field, either as a range name string; determines the values to be sorted.

SortOrder order1

Determines the sort order for the values specified in key1.

string key2

Second sort field; cannot be used when sorting a PivotTable.

SortType type

Specifies which type of elements are to be sorted within a PivotTable. Specify SortLabels to sort by the labels targeted by the experession range in the Row/Colum Labels areas of the PivotTable's range, or SortValues when key1 additionally targets a cell in the Values or Sub/Grand Totals areas using R1C1 notation.

SortOrder order2

Determines the sort order for the values specified in key2.

string key3

Third sort field; cannot be used when sorting a PivotTable.

SortOrder order3

Determines the sort order for the values specified in key3.

YesNoGuess header

Specifies whether the first row contains header information. No is the default value; specify YesNoGuess if you want Spread to attempt to determine the header.

bool matchCase

Set to true to perform a case-sensitive sort, false to perform a non-case-sensitive sort; cannot be used with PivotTables.

SortMethod sortMethod

Specifies the sort method.

SortDataOption dataOption1

Specifies how to sort text in the range specified in key1; does not apply to PivotTable sorting.

SortDataOption dataOption2

Specifies how to sort text in the range specified in key2; does not apply to PivotTable sorting.

SortDataOption dataOption3

Specifies how to sort text in the range specified in key3; does not apply to PivotTable sorting.