Rewrite the names of other workbooks' sheets in a formula. Each such sheet is
replaced by replace, which returns the new text before !, or undefined
when the formula cannot be written that way. Text in quotes and structured
references stay as they are. A folder before [ in a quoted name is left
out.
Declaration
function rewriteExternalSheets( formula: string,): string | undefinedParameters
formula: stringrequiredFormula text, with or without the leading =.
replace: (name: ExternalSheetName) => string | undefinedrequiredCalled for each name of another workbook; returns its new text.
Returns
string | undefinedThe new formula, or undefined when replace returned undefined for any name.