updateFormulas
Pass a map to replace sheet names wholesale — the usual need after a rename or a copy — or a function to decide each formula for itself. The function receives the formula and returns the one to put back.
Only cells that hold a formula are visited, and only the ones that actually changed are written, so a no-op costs one read and nothing else.
A sheet means its whole data range; a range means only the cells inside it, so a rewrite can be confined to one block. The row and column handed to the transformer are positions on the sheet either way, which is what makes a formula's own address usable in the replacement.
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The sheet whose formulas are rewritten, or the range to rewrite within: only its cells are read and written. |
|
| A map of old sheet name to new one, or a function taking a formula and returning its replacement. |
Returns
number — how many formulas were rewritten.
Throws
Exception | Condition |
|---|---|
| the first argument is neither a sheet nor a range. |
Examples
Rewriting formulas
Within one block
See also
Source
This documentation was generated with AI (Claude) from the library's source code.