Skip to main content

GetCells

Returns a Range object that represents all the cells in the specified range or a specified cell.

Syntax

expression.GetCells(row, col);

expression - A variable that represents a ApiRange class.

Parameters

NameRequired/OptionalData typeDefaultDescription
rowRequirednumberThe row number or the cell number (if only row is defined).
colRequirednumberThe column number.

Returns

ApiRange

Example

This example shows how to get a Range object that represents all the cells in the specified range or a specified cell.

var oWorksheet = Api.GetActiveSheet();
var oRange = oWorksheet.GetRange("A1:C3");
oRange.GetCells(2, 1).SetFillColor(Api.CreateColorFromRGB(255, 213, 191));