Home

getRange

GetRange is a common method name used in spreadsheet scripting and data-processing APIs to retrieve a contiguous subset of elements from a larger collection, such as a worksheet, an array, or a dataset. The exact behavior varies by API, but the core idea is to specify a starting point and a size to operate on a limited region.

In Google Apps Script, a widely used implementation is in the Spreadsheet service. Sheet.getRange can accept

Beyond Apps Script, getRange or similarly named functions appear in other libraries where a subset of data

Common usage patterns include retrieving large blocks of data in one call for efficiency, then processing locally,

See also: Range, A1 notation, getValues, setValues, RangeList.

either
an
A1
notation
string
(for
example,
'A1:B2')
or
four
integers
(row,
column,
numRows,
numColumns).
The
method
returns
a
Range
object,
which
can
be
queried
or
modified
with
methods
like
getValues,
setValues,
getDisplayValues,
and
more.
This
enables
bulk
data
access
or
updates
in
a
single
operation.
is
needed.
The
concept
applies
to
various
data
structures:
a
range
of
cells
in
a
spreadsheet,
a
slice
of
an
array,
or
a
sub-collection
defined
by
indices.
Indexing
may
be
one-based
or
zero-based
depending
on
the
API,
which
can
lead
to
off-by-one
errors
when
switching
contexts.
and
using
specific
overloads
to
target
a
single
cell
or
a
compact
rectangle.
Developers
should
validate
bounds,
understand
whether
the
API
uses
A1
notation
or
numerical
indices,
and
choose
the
most
appropriate
method
to
minimize
repeated
calls.