function onEdit(e) {
if (!e) return;
var range = e.range;
var sheet = range.getSheet();
var SheetName = "Civilian";
if (sheet.getName() === SheetName) {
// Get the edited cell's address
var editedCell = range.getA1Notation();
if (editedCell === "J5") {
var oldValue = e.oldValue;
if (oldValue === undefined) {
oldValue = '';
}
sheet.getRange("K5").setValue(oldValue);
}
}
}
The script above is meant to check if J5 is edited. If edited, its previous value is to be updated to K5. However, since J5 has a formula, it’s not working.
Is there a workaround to this?
New contributor
ApertureGaming011 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.