onEdit Function for Google Sheets
GOOGLE APP SCRIPT
var sheetName = "Sheet1"
function onEdit() {
var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName);
var activeCell = ss.getActiveCell();
var row = activeCell.getRow();
var col = activeCell.getColumn();
var timeStamp = ss.getRange(row,col-1).getValue();
var rowHeader = ss.getRange(3,col).getValue();
if(!activeCell.isBlank() && timeStamp == "" && rowHeader == "COMPLETED" && row > 3){
ss.getRange(row, col-1).setValue(new Date());
}
}
Use This OnEdit Function For Time Stamp

Comments
Post a Comment