Skip to content

Instantly share code, notes, and snippets.

@DimuDesigns
Last active April 28, 2017 12:23
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 DimuDesigns/50ebd7fe43c999877ffc3207c287c023 to your computer and use it in GitHub Desktop.
Save DimuDesigns/50ebd7fe43c999877ffc3207c287c023 to your computer and use it in GitHub Desktop.
onEdit Sample
function onEdit(e) {
if (e.range.getA1Notation() == "C3" && e.value != e.oldValue) {
var row = 0;
while(!e.range.offset(row++,1).isBlank()) {}; // post-increment operator updates row index after its evaluated in the statement
e.range.offset(row - 1,1).setValue(new Date()).setNumberFormat('yyyy-MM-dd HH:mm:ss');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment