Intersect

function Intersect(Range1: ApiRange = null, Range2: ApiRange = null): ApiRange | "null"

Description

Returns the ApiRange object that represents the rectangular intersection of two or more ranges. If one or more ranges from a different worksheet are specified, an error will be returned.

Parameters

Range1ApiRangedefault: null

One of the intersecting ranges. At least two Range objects must be specified.

Range2ApiRangedefault: null

One of the intersecting ranges. At least two Range objects must be specified.

Returns

ApiRange | "null"

Try It

var oWorksheet = Api.GetActiveSheet();
var oRange1 = oWorksheet.GetRange("A1:C5");
var oRange2 = oWorksheet.GetRange("B2:B4");
var oRange = Api.Intersect(oRange1, oRange2);
oRange.SetFillColor(Api.CreateColorFromRGB(255, 213, 191));

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).