Skip to content
Sheetwrite

@sheetwrite/formulas

renameStructuredReferencefunction

Report a problem

On this page

Rename a table or a table column in the structured references of a formula, as Excel updates formulas when a table or a column is renamed. An empty column renames table table to to; otherwise column column of table becomes to, where an empty table means references without a table name. Names match without case.

Declaration

function renameStructuredReference(
source: string,
table: string,
column: string,
to: string,
): string

Parameters

source: stringrequired

Formula text.

table: stringrequired

Table whose references change; empty, with a column, means references without a table name.

column: stringrequired

Column to rename; empty renames the table itself.

to: stringrequired

The new table or column name.

Returns

string

The formula with the matching structured references renamed; the text unchanged when it can't be read as a formula.

Referenced by

Public exports naming renameStructuredReference