At Google Sheets
, click Tools -> Script Editor
.
The following code will update Column J
to 1
when row is edited/modified.
function onEdit(e) { var range = e.range; var sheet = range.getSheet(); var updateCol = "J"; var updateCoIndex = updateCol.charCodeAt(0) - 64 /* // limit to specific sheet // sheet.getSheetId() if (sheet.getName() !== sheetName) { return; } */ if (range.getColumn() != updateColIndex) { var row = range.getRow() // Update Column J to 1 when row is edited var updateRange = sheet.getRange(updateCol + row.toString()); updateRange.setValue(1); // range.setNote('Last modified: ' + new Date()); }}
References: