GetRows

GetRows(nRow) → { ApiRange | null }

Returns a Range object that represents the rows in the specified range. If the specified row is outside the Range object, a new Range will be returned that represents the cells between the columns of the original range in the specified row.

Parameters:

Name Type Description
nRow number

The row number (starts counting from 1, the 0 value returns an error).

Returns:

Type
ApiRange | null

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var oRange = oWorksheet.GetRange("1:3");
for (let i=1; i <= 3; i++) {
    var oRows = oRange.GetRows(i);    
    oRows.SetValue(i);
}
builder.SaveFile("xlsx", "GetRows.xlsx");
builder.CloseFile();

Resulting document