Skip to content

CellVertexId

Vertex ID representing a cell in a sheet.

new CellVertexId(
workbookKey,
sheetIndex,
rowIndex,
colIndex): CellVertexId;

number

The dependency graph key of the workbook

number

Zero-based sheet index

number

Zero-based row index

number

Zero-based column index

CellVertexId

VertexId.constructor

colIndex: number;

Zero-based index of the column containing this cell (e.g. 2 for column C of C5).


key: string;

Underlying string encoding of the identifier. Guaranteed to be identical for two vertex ID instances that identify the same thing within a model, and to be distinct for instances that don’t.

VertexId.key


rowIndex: number;

Zero-based index of the row containing this cell (e.g. 4 for row 5 of C5).


sheetIndex: number;

Zero-based index of the worksheet containing this cell


workbookKey: number;

Key identifying a workbook in this model. Although it is numeric, the number does not necessarily indicate its ordering in the model.

VertexId.workbookKey

get bottom(): number;

Zero-based row index

number


get left(): number;

Zero-based column index

number


get right(): number;

Zero-based column index

number


get top(): number;

Zero-based row index

number

contains(otherId): boolean;

Check whether this vertex ID fully contains another (meaning all of the other vertex ID is within this one)

KnownVertexId

boolean

VertexId.contains


offset(rows, cols): CellVertexId;

Get a cell vertex ID at the given offset from this one, in the same sheet.

number

the number of rows to offset (negative for upward offset)

number

the number of columns to offset (negative for leftward offset)

CellVertexId


overlaps(otherId): boolean;

Check whether this range overlaps another vertex ID.

False if not the same workbook and sheet.

KnownVertexId

boolean

VertexId.overlaps


topLeft(): CellVertexId;

Top-left cell

CellVertexId

this


toRange(): Range;

Derive a bare Range for the cell represented by this vertex ID, without workbook or sheet attachment.

Range

VertexId.toRange


toString(): string;

string

VertexId.toString


visitCells(callback, bounds?): void;

Visit this cell vertex ID with the given callback if it is within the given bounds.

CallbackWithStop<CellVertexId>

function to call with each cell vertex ID

the maximum 0-based x and y coordinates to visit. If not specified, then all coordinates of this range vertex ID are visited.

number

number

void


withCoordinates(x, y): CellVertexId;

Get a cell vertex ID for the given coordinates in the same sheet as this one.

number

zero-based column index

number

zero-based row index

CellVertexId


static fromKey(key): KnownVertexId;

Make a VertexId instance for the given key. Two calls with the same key will return distinct but equivalent instances.

string

KnownVertexId

VertexId.fromKey