HotXLS Docs

SelectAreas method

Selects one or more A1-style ranges on a classic XLS worksheet and writes a multi-area Selection record when needed.

Syntax

function SelectAreas(const Areas: array of WideString): Integer; overload;
function SelectAreas(const Areas: array of WideString; ActiveAreaIndex: Integer): Integer; overload;
    

Parameters

Areas One or more A1-style cell or range references, such as 'A1:B2' or 'D4'.
ActiveAreaIndex 0-based index of the active area. If omitted, the first area is active.

Return value

Returns 1 when the selection is accepted, or -1 when the area list is empty, the active index is invalid, or any A1 reference cannot be parsed.

Example

Workbook.Sheets[1].SelectAreas(
  ['A1:B2', 'D4'],
  1);
    

See also

IXLSWorksheet class
IXLSWorksheet.Selection property
IXLSWorksheet.Select method