Advertisement
RemcoE33

Google sheets timestamp with user

Jun 21st, 2021 (edited)
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function onEdit(e){
  2.   const criteriaSheet = 'Turbo'
  3.   if (e.source.getActiveSheet().getName() == criteriaSheet){
  4.     const email = Session.getActiveUser().getEmail()
  5.     const now = Utilities.formatDate(new Date(), Session.getScriptTimeZone(), "yyyy-MM-dd hh:mm");
  6.  
  7.     e.source.getActiveSheet().getRange("C4:D4").setValues([[email,now]]);
  8.   }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement