Minor tweak

This commit is contained in:
MarkBaker 2022-09-23 15:34:18 +02:00
parent 6f5597d7b1
commit eb91890f8b
1 changed files with 2 additions and 3 deletions

View File

@ -906,11 +906,10 @@ class ReferenceHelper
$asFormula = ($cellAddress[0] === '=');
if ($definedName->getWorksheet() !== null && $definedName->getWorksheet()->getHashCode() === $worksheet->getHashCode()) {
if ($asFormula === true) {
$formula = $definedName->getValue();
$formula = $this->updateFormulaReferences($formula, $beforeCellAddress, $numberOfColumns, $numberOfRows, $worksheet->getTitle());
$formula = $this->updateFormulaReferences($cellAddress, $beforeCellAddress, $numberOfColumns, $numberOfRows, $worksheet->getTitle());
$definedName->setValue($formula);
} else {
$definedName->setValue($asFormula . $this->updateCellReference(ltrim($cellAddress, '=')));
$definedName->setValue($this->updateCellReference(ltrim($cellAddress, '=')));
}
}
}