ROWS
Returns the number of rows in a range.
Syntax
expression.ROWS(arg1);
expression
- A variable that represents a ApiWorksheetFunction class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
arg1 | Required | ApiRange | ApiName | (number | string | boolean)[] | A range of cells or an array for which the number of rows will be returned. |
Returns
number
Example
- Code
- Result
let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
let column1 = [13, 14, 15];
let column2 = [23, 24, 25];
for (let i = 0; i < column1.length; i++) {
worksheet.GetRange("A" + (i + 1)).SetValue(column1[i]);
}
for (let j = 0; j < column2.length; j++) {
worksheet.GetRange("B" + (j + 1)).SetValue(column2[j]);
}
let range = worksheet.GetRange("A1:B3");
worksheet.GetRange("C3").SetValue(func.ROWS(range));