Skip to main content

GetRangeByNumber

Returns an object that represents the selected range of the current sheet using the - row/column coordinates for the cell selection.

Syntax

expression.GetRangeByNumber(nRow, nCol);

expression - A variable that represents a ApiWorksheet class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nRowRequirednumberThe row number.
nColRequirednumberThe column number.

Returns

ApiRange

Example

Locate a cell using row and column numbers instead of letters in a spreadsheet.

// Pick cells by their numeric positions without using address notation in a spreadsheet?

// Enter data into a cell when you know only its row and column count in a spreadsheet.

let worksheet = Api.GetActiveSheet();
worksheet.GetRangeByNumber(1, 2).SetValue("42");