Skip to content

A1Ref

Represents an A1-style cell or range reference with optional workbook and sheet context

new A1Ref(range: string | Range | A1Ref, context?: RefContext): A1Ref;

Creates a new A1Ref instance

ParameterTypeDescription
rangestring | Range | A1RefA string reference (e.g., “A1”, “Sheet1!A1:B2”), Range object, or existing A1Ref to clone
context?RefContextOptional context providing workbook and sheet names

A1Ref

When the reference is invalid or coordinates are out of bounds

PropertyTypeDescription
rangeRangeThe range coordinates
sheetNamestringName of the sheet containing this reference
workbookNamestringName of the workbook containing this reference
get bottom(): number;

Gets the bottom row index

number


get height(): number;

Gets the height of the range (number of rows)

number


get left(): number;

Gets the left column index

number


get right(): number;

Gets the right column index

number


get top(): number;

Gets the top row index

number


get width(): number;

Gets the width of the range (number of columns)

number

toString(): string;

Converts the reference to its A1 string representation

string

The A1-style string representation (e.g., “Sheet1!A1:B2”)