NativeExcel suite v2.x

UsedRange property

Returns a IXLSRange object that represents the used range on the specified worksheet. Read-only.

Syntax

property UsedRange: IXLSRange;

Example

This example selects the used range on the first sheet.
WorkBook.Sheets[1].UsedRange.Select;
This example sets the font style in used cells on the first sheet to italic.
Workbook.Sheets[1].UsedRange.Font.Italic := True;
This example sets the font style for every second row in the used range to bold.
With Workbook.Sheets[1].UsedRange do begin
  for i := 1 to Rows.Count do
    if (i mod 2) = 0 then Rows[i].Font.Bold := True;
end;
Copyright © NikaSoft 2004-2012