NativeExcel suite v2.x

Offset property

Returns an IXLSRange object that represents a range that's offset from the specified range. Read-only.

Syntax

property Offset[RowOffset: integer; ColumnOffset: integer]: IXLSRange;
RowOffsetInteger. The number of rows (positive, negative, or zero) by which the range is to be offset. Positive values are offset downward, and negative values are offset upward.
ColumnOffsetInteger. The number of columns (positive, negative, or zero) by which the range is to be offset. Positive values are offset to the right, and negative values are offset to the left.

Example

This example demonstrates how to use Offset property for the iteration through range of cell.
With Workbook.Sheets[1].Range['A1', 'A1'] do begin
   for row := 0 to 1000 do
     for col := 0 to 100 do
         Offset[row, col].Value := (row + 1)*(col + 1);
end;
Copyright © NikaSoft 2004-2012