HotXLS 文档

UsedRange 属性

返回 a IXLSRange object that represents the used range on the specified Worksheet. Read-only

语法

property UsedRange: IXLSRange;

示例

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;