Allows you to sort the cells of a sheet according to one or more columns.
Syntax
CHGVAR |
VAR(&CMD) VALUE('XLSUBTOTAL') |
CHGVAR |
VAR(&PARM1) VALUE(' |
CHGVAR |
VAR(&PARM2) VALUE(' ') |
CALL |
PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 + &PARM2 &RESULT) |
Parameters
Parameters |
|
Parm1 |
All cells in the sheet will be sorted. Key1,
Key2, Key3: Coordinates of the 1st cell of the column from which
you want to sort. Key1 will be the priority sort order, followed by Key2 and Key3.
Order1,
Order2, Order3: Sort order. Corresponds to Key1, Key2 and Key3
respectively. The values can be: Header:
Specifies whether the sheet contains a row of column headers, so that it does
not form part of the sort.
|
Example
We want to sort the cells of the active sheet according to the values of column H (decreasing values), and then, the result of this first sorting will be ordered according to the values of column A (increasing values).
The first row of column headers will not be taken into account for sorting.
LNCCMD CMD(EXCELOPEN) +
PARM1('C:\A\sp_cust_ref.xlsx') +
PARM2('visible')
LNCCMD CMD(XLSORT) +
PARM1('Key2="$A$2";Order2=xlAscending;Key1=+
"$H$2";Order1=xlDescending;Header=xlYes')