jeudi 10 octobre 2019

script to clear note from unchecked checkbox

I'm not a programmer but like to play around with scripts every now and then as a hobby.

I built a spreadsheet to capture the timestamp in a 'note' every time a checkbox is checked, by piecing together code from various sources. However, I can't clear the note in the checkbox, when it is unchecked.

function onEdit(e){ if(e.value != "TRUE") return; e.source.getActiveSheet().getRange(e.range.rowStart,e.range.columnStart).setNote('Completed: ' + Utilities.formatDate(new Date(), SpreadsheetApp.getActive().getSpreadsheetTimeZone(), "dd-MM-yy HH:mm:ss")); }

a side note: is this possible with comments instead of notes?




Aucun commentaire:

Enregistrer un commentaire