|
|
|
|
|
<Spreadsheet>.SortSelection (Function) In french: <Tableur>.TrieSélection Sorts the values selected in a Spreadsheet control. // Sorts the [A2:B5] cells of current worksheet PSHEET_Spreadsheet.SelectPlus("A2", "B5") PSHEET_Spreadsheet.SortSelection(asAscending)
// Sorts the entire worksheet // Selects a cell PSHEET_Spreadsheet = "A1" // Sorts all the rows and columns with data below and on the right PSHEET_Spreadsheet.SortSelection(asAscending) IF ErrorOccurred = True THEN Error(ErrorInfo()) END
// Sorts the selection according to different criteria // Column A: Ascending sort // Column B: Descending sort PSHEET_Spreadsheet.SortSelection("A" + TAB + "B" + asDescending) IF ErrorOccurred = True THEN Error(ErrorInfo()) END
Syntax
Sorting the selection according to a sort criterion Hide the details
<Spreadsheet control>.SortSelection(<Options>)
<Spreadsheet control>: Control name Name of the Spreadsheet control to be used. <Options>: Integer constant (or combination of constants) Sort options: | | asAscending (Default value) | Ascending sort. | asDescending | Descending sort. | tccIgnoreAccent | Sort while ignoring the accented characters. | tccIgnoreCase | Sort while ignoring the case. | tccIgnoreInsideSpace | Sort while ignoring the space characters found inside the strings. | tccIgnorePonctuationAndSpace | Sort while ignoring the space and punctuation characters. | tccIgnoreSpace | Sort while ignoring the space characters found at the beginning and end of strings. | tccLexicographicOrder | Sort based on the linguistic order. | tccRespectNumeric | Sort while respecting the order of numeric values. |
Sorting the selection according to several sort criteria Hide the details
<Spreadsheet control>.SortSelection(<Criteria>)
<Spreadsheet control>: Control name Name of the Spreadsheet control to be used. <Criteria>: Character string Sort criteria in the following format:
"<Name column1>[;< Option>]" + TAB + "<Name column2>[;< Option>]" + TAB + ... where: - <Name column> corresponds to the name of column to sort.
- <Option> corresponds to a constant (or to a combination of constants) used to define the sort that will be applied to the column. If this parameter is not specified, the asAscending constant will be used. This parameter can correspond to:
| | asAscending (Default value) | Ascending sort. | asDescending | Descending sort. | tccIgnoreAccent | Sort while ignoring the accented characters. | tccIgnoreCase | Sort while ignoring the case. | tccIgnoreInsideSpace | Sort while ignoring the space characters found inside the strings. | tccIgnorePonctuationAndSpace | Sort while ignoring the space and punctuation characters. | tccIgnoreSpace | Sort while ignoring the space characters found at the beginning and end of strings. | tccLexicographicOrder | Sort based on the linguistic order. | tccRespectNumeric | Sort while respecting the order of numeric values. |
Remarks - The sort is performed on the current selection.
- If a single cell is selected, the function searches for the best selection: all the rows and columns with data below and on the right.
- If no sort can be performed, the ErrorOccurred variable is set to True and the error details are returned by ErrorInfo.
- The first column is used as sort criterion.
- The sort can be canceled by the user via Ctrl + Z.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|