HotXLS Delphi Excel Read Write Library / Component Developers Guide loslab Inc.

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©2014 loslab.com