ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Spreadsheet functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Sorts the values selected in a Spreadsheet control.
Example
// Trie les cellules [A2:B5] de la feuille en cours
SpreadsheetSelectPlus(TBLR_Tableur, "A2", "B5") 
SpreadsheetSortSelection(TBLR_Tableur, asAscending)
// Trie toute la feuille
// Sélectionne une cellule
TBLR_Tableur = "A1" 
// Trie toutes les ligne et colonnes avec des données en dessous et à droite 
SpreadsheetSortSelection(TBLR_Tableur, asAscending)
IF ErrorOccurred = True THEN
	Error(ErrorInfo())
END
// Trie la sélection selon différents critères
// Colonne A : Tri croissant
// Colonne B : Tri décroissant
SpreadsheetSortSelection(TBLR_Tableur, "A" + TAB + "B" + asDescending)
IF ErrorOccurred = True THEN
	Error(ErrorInfo())
END
Syntax

Sorting the selection according to a sort criterion Hide the details

SpreadsheetSortSelection(<Spreadsheet control> , <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.
asDescendingDescending sort.
tccIgnoreAccentSort while ignoring the accented characters.
tccIgnoreCaseSort while ignoring the case.
tccIgnoreInsideSpaceSort while ignoring the space characters found inside the strings.
tccIgnorePunctuationAndSpaceSort while ignoring the space and punctuation characters.
tccIgnoreSpaceSort while ignoring the space characters found at the beginning and end of strings.
tccLexicographicOrderSort based on the linguistic order.
tccRespectNumericSort while respecting the order of numeric values.

Sorting the selection according to several sort criteria Hide the details

SpreadsheetSortSelection(<Spreadsheet control> , <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 constant used will be ttCroissant. This parameter can correspond to:
    asAscending
    (Default value)
    Ascending sort.
    asDescendingDescending sort.
    tccIgnoreAccentSort while ignoring the accented characters.
    tccIgnoreCaseSort while ignoring the case.
    tccIgnoreInsideSpaceSort while ignoring the space characters found inside the strings.
    tccIgnorePunctuationAndSpaceSort while ignoring the space and punctuation characters.
    tccIgnoreSpaceSort while ignoring the space characters found at the beginning and end of strings.
    tccLexicographicOrderSort based on the linguistic order.
    tccRespectNumericSort while respecting the order of numeric values.
Remarks
  • The sort is performed on the current selection.
  • If only one cell is selected, the function searches for the best selection: all rows and columns with data below and to 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.
Component: wd300obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help