Click or drag to resize

ExcelRangeSort(ExcelSortKey, Boolean) Method

Sorts the rows of this range by one or more columns: the rows with equal values in the first key column are sorted by the second key column and so on; rows with equal keys keep their order. The values, formulas and cell formats move with the rows; the relative references of the moved formulas are adjusted to the new row, as in Excel. Numbers and dates come before texts, texts are compared without regard to case and the blank cells are placed last. Formula cells are sorted by their calculated results (call UpdateFormulaResult first for the formulas added in code). The range cannot contain merged cells.

Namespace: ExpertXls.ExcelLib
Assembly: expertxls (in expertxls.dll) Version: 10.0.0
Syntax
public void Sort(
	ExcelSortKey[] sortKeys,
	bool hasHeaderRow
)

Parameters

sortKeys  ExcelSortKey
The columns to sort by, in order of priority.
hasHeaderRow  Boolean
True if the first row of the range is a header row that is not sorted.
See Also