Sort Cells

From Documentation
Revision as of 02:11, 13 August 2013 by Hawk (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)



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:

Zss-essentials-sortBefore.png

A range of cells after sorting in ascending order:

Zss-essentials-sortAfter.png



All source code listed in this book is at Github.


Last Update : 2013/08/13

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.