encodeRange
On this page
Encode a Range or pair of CellAddresses to an A1:B2 range string.
Can be called as:
encodeRange(range)with a Range objectencodeRange(start, end)with two CellAddress objects
If start and end are the same cell, returns a single cell reference (no colon).
encodeRange(cs: CellAddress | Range, ce?: CellAddress): string
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
cs | CellAddress | Range | Yes | A Range object, or the start CellAddress |
ce | CellAddress | No | Optional end CellAddress (when cs is a CellAddress) |
Returns
string
Range string in A1 notation (e.g. "A1:B2" or "A1")