Spreadsheet.SortData
This function sorts the specified variables in the spreadsheet by ascending, numeric order.
| Syntax | Parameters | Return Value |
|---|---|---|
Sub Spreadsheet.SortData( _
Key1 As Variant, _
Optional Order1 As Variant, _
Optional By1 As Variant, _
Optional Key2 As Variant, _
Optional Order2 As Variant, _
Optional By2 As Variant, _
Optional Key3 As Variant, _
Optional Order3 As Variant, _
Optional By3 As Variant, _
Optional Key4 As Variant, _
Optional Order4 As Variant, _
Optional By4 As Variant, _
Optional Key5 As Variant, _
Optional Order5 As Variant, _
Optional By5 As Variant, _
Optional Key6 As Variant, _
Optional Order6 As Variant, _
Optional By6 As Variant, _
Optional Key7 As Variant, _
Optional Order7 As Variant, _
Optional By7 As Variant)
|
Which variable to sort. Type: Variant
Integer value specifying sorting order. The following constants can be used as arguments for this parameter: scSortAscending, scSortDescending. Note that this parameter defaults to scSortAscending. Type: Variant
The sorting criteria. The following constants can be used as arguments for this parameter: scSortByNumeric, scSortByText. Note that this parameter defaults to scSortByNumeric. Type: Variant
Which variable to sort. Type: Variant
Integer value specifying sorting order. The following constants can be used as arguments for this parameter: scSortAscending, scSortDescending. Note that this parameter defaults to scSortAscending. Type: Variant
The sorting criteria. The following constants can be used as arguments for this parameter: scSortByNumeric, scSortByText. Note that this parameter defaults to scSortByNumeric. Type: Variant
Which variable to sort. Type: Variant
Integer value specifying sorting order. The following constants can be used as arguments for this parameter: scSortAscending, scSortDescending. Note that this parameter defaults to scSortAscending. Type: Variant
The sorting criteria. The following constants can be used as arguments for this parameter: scSortByNumeric, scSortByText. Note that this parameter defaults to scSortByNumeric. Type: Variant
Which variable to sort. Type: Variant
Integer value specifying sorting order. The following constants can be used as arguments for this parameter: scSortAscending, scSortDescending. Note that this parameter defaults to scSortAscending. Type: Variant
The sorting criteria. The following constants can be used as arguments for this parameter: scSortByNumeric, scSortByText. Note that this parameter defaults to scSortByNumeric. Type: Variant
Which variable to sort. Type: Variant
Integer value specifying sorting order. The following constants can be used as arguments for this parameter: scSortAscending, scSortDescending. Note that this parameter defaults to scSortAscending. Type: Variant
The sorting criteria. The following constants can be used as arguments for this parameter: scSortByNumeric, scSortByText. Note that this parameter defaults to scSortByNumeric. Type: Variant
Which variable to sort. Type: Variant
Integer value specifying sorting order. The following constants can be used as arguments for this parameter: scSortAscending, scSortDescending. Note that this parameter defaults to scSortAscending. Type: Variant
The sorting criteria. The following constants can be used as arguments for this parameter: scSortByNumeric, scSortByText. Note that this parameter defaults to scSortByNumeric. Type: Variant
Which variable to sort. Type: Variant
Integer value specifying sorting order. The following constants can be used as arguments for this parameter: scSortAscending, scSortDescending. Note that this parameter defaults to scSortAscending. Type: Variant
The sorting criteria. The following constants can be used as arguments for this parameter: scSortByNumeric, scSortByText. Note that this parameter defaults to scSortByNumeric. Type: Variant |
This function does not return a value. |
SVB Example
Sorting variables:
Option Base 1
Option Explicit
Sub Main
Dim spr As Spreadsheet
'assigns the active spreadsheet to the object spr
Set spr = ActiveSpreadsheet
'sorts the cell values in variable 1 in ascending order
'based on their numeric values, then sorts the second
'variable in descending order numerically
spr.SortData(1,scSortAscending,scSortByNumeric, _
2, scSortDescending, scSortByNumeric)
End Sub