apps-script-utils 2.1.1 Help

isGridRangeSameDimensions

function isGridRangeSameDimensions(range1: GridRange, range2: GridRange): boolean;

Where they sit does not matter, only how big they are — the question to ask before copying values from one range into another, since setValues rejects a mismatch.

Parameters

Parameter

Type

Description

range1

GridRange

The first range.

range2

GridRange

The second range.

Returns

boolean — true when both are the same size.

Examples

Comparing sizes

const source = { startRowIndex: 0, endRowIndex: 2, startColumnIndex: 0, endColumnIndex: 2 }; const target = { startRowIndex: 5, endRowIndex: 7, startColumnIndex: 5, endColumnIndex: 7 }; isGridRangeSameDimensions(source, target); // => true

See also

Source

src/appsscript/sheet/isGridRangeSameDimensions.ts

23 September 2026

This documentation was generated with AI (Claude) from the library's source code.