Skip to main content

SetOffset

Sets the cell offset.

Syntax

expression.SetOffset(nRow, nCol);

expression - A variable that represents a ApiRange class.

Parameters

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

Returns

This method doesn't return any data.

Example

This example sets the cell offset.

var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("B3").SetValue("Old Range");
var oRange = oWorksheet.GetRange("B3");
oRange.SetOffset(2, 2);
oRange.SetValue("New Range");