Skip to content Skip to sidebar Skip to footer

How To Fix Cell History In Cell Note?

I found a script that's supposed to add cell history in a note, the original one found here(https://www.pbainbridge.co.uk/2019/07/add-note-to-cell-on-google-sheet-edit.html) does n

Solution 1:

function onEdit(e){
  const sh=e.range.getSheet();
  const A1=sh.getRange(e.range.rowStart,e.range.columnStart).getA1Notation();
  const rg=sh.getRange(e.range.rowStart,18);
  const dt=Utilities.formatDate(new Date(),Session.getScriptTimeZone(),"MM/dd/yyyy HH:mm:ss")
  const newNote=Utilities.formatString('Last Modified:%s cell:%s Value:%s\n',dt,A1,e.value);
  rg.setNote(rg.getNote() + newNote);
}

Post a Comment for "How To Fix Cell History In Cell Note?"