Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iSanjayAchar/3f25bc946e0f7f5c4c3895706fa6336b to your computer and use it in GitHub Desktop.
Save iSanjayAchar/3f25bc946e0f7f5c4c3895706fa6336b to your computer and use it in GitHub Desktop.
Google App Script to Log Time And Date onEdit
function onEdit(e) {
var sheet = e.source.getActiveSheet();
var activeCell = sheet.getActiveCell();
var col = activeCell.getColumn();
var row = activeCell.getRow();
if (col == 2 ) { // assuming status is in column 2, adapt if needed
sheet.getRange(row, col+1).setValue(new Date()).setNumberFormat('MMM dd yyyy - HH:mm');// change the display format to your preference here
}
}
//As we are using onEdit no triggers has to be setup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment