mercredi 7 août 2019

Create checkbox in cell by typing in another cell

I want to create checkbox in column E cell by typing in column A cell. Is it possible?

Get the day of each month entered by typing in column A. sheet here

function onEdit(event)
{ 
  var timezone = "GMT-3";
  var timestamp_format = "dd"; // Timestamp Format. 
  var updateColName = "NOME";
  var timeStampColName = "DIA ";
  var sheet = event.source.getActiveSheet()


  var actRng = event.source.getActiveRange();
  var editColumn = actRng.getColumn();
  var index = actRng.getRowIndex();
  var headers = sheet.getRange(5, 1, 1, sheet.getLastColumn()).getValues();
  var dateCol = headers[0].indexOf(timeStampColName);
  var updateCol = headers[0].indexOf(updateColName); updateCol = updateCol+1;
  Logger.log(dateCol+" "+editColumn+" "+updateCol+" "+index)
  if (dateCol > -5 && index > 5 && editColumn == updateCol) { // only timestamp if 'Last Updated' header exists, but not in the header row itself!
    var cell = sheet.getRange(index, dateCol + 1);
    var date = Utilities.formatDate(new Date(), timezone, timestamp_format);
    cell.setValue(date);
  }
  }




Aucun commentaire:

Enregistrer un commentaire