Sort Cells"
From Documentation
(Created page with "{{ZKSpreadsheetEssentials3PageHeader}} Sorting a range of cell data is a commonly-used feature. To sort cells with <tt>Range</tt> is quite easy like: <source lang='java'> //t...") |
m (correct highlight (via JWB)) |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
− | Sorting a range of cell data is a commonly-used feature. To sort cells with < | + | Sorting a range of cell data is a commonly-used feature. To sort cells with <code>Range</code> is quite easy like: |
<source lang='java'> | <source lang='java'> |
Latest revision as of 12:53, 19 January 2022
Sorting a range of cell data is a commonly-used feature. To sort cells with Range
is quite easy like:
//true for descending order, false for ascending
range.sort(true);
//use CellOperationUtil, it checks sheet protection before sorting
CellOperationUtil.sort(range, true);
When sorting a range of texts and numbers In ascending order, numbers will be arranged before text.
A range of cells before sorting:
A range of cells after sorting in ascending order:
All source code listed in this book is at Github.