dimanche 23 février 2020

Checkbox triggered clearcontent Script then automatically unchecking it immediately

I'm looking for clearing a range with checking a checkbox, then having the script to uncheck it.

This is what I tried so far, but besides the fact it's looping, I don't know how to force the TRUE to FALSE automatically whenever a FALSE becomes a TRUE.

function onEdit(e) {
  var aCell = e.source.getActiveCell(), col = aCell.getColumn(); 
  if(col == 2) { 
    var app = SpreadsheetApp;
    var activeSheet = app.getActiveSpreadsheet().getActiveSheet();
activeSheet.getRange("D4:D6").clearContent()
  }}



Aucun commentaire:

Enregistrer un commentaire