Skip to content

Instantly share code, notes, and snippets.

@GitHubKtShoe
Last active January 20, 2022 18:36
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 GitHubKtShoe/ddd6cf162885590521a8eadb10632f35 to your computer and use it in GitHub Desktop.
Save GitHubKtShoe/ddd6cf162885590521a8eadb10632f35 to your computer and use it in GitHub Desktop.
This will produce a timestamp and a username email in Columns 1 and 2 of any sheet in google Sheets
function onEdit(e) {
var row = e.range.getRow()
var sh = e.source.getActiveSheet();
var col = e.range.getColumn()
var header = sh.getRange(1, col).getValue(); // I know this is var is not right...
if (row > 1 && col > 2){
e.source.getActiveSheet()
.getRange(row,1)
.setValue(new Date());}
if (row > 1 && col > 2){e.source.getActiveSheet()
.getRange(row, 2)
.setValue(e.user.getEmail() )}
;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment