Created
May 26, 2016 08:36
-
-
Save iSanjayAchar/3f25bc946e0f7f5c4c3895706fa6336b to your computer and use it in GitHub Desktop.
Google App Script to Log Time And Date onEdit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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