Home > other >  Google Sheets - How to move every single row downwards based on a cell's status
Google Sheets - How to move every single row downwards based on a cell's status

Time:12-14

I'm sorry if the title is confusing. Basically, I'm trying to make a log register enter image description here

Drop Down one row:

function onEdit(e) {
  e.source.toast("Entry");
  const sh = e.range.getSheet();
  if(sh.getName() == "Log" && e.range.columnStart == 4 && e.range.rowStart == 2) {
    e.source.toast('Gate1')
    e.range.offset(0, -3).setValue(e.range.offset(1,-3).getValue()   1);
    e.range.offset(0, -2).setValue(new Date()).setNumberFormat("MM/dd/yyyy");
    e.range.offset(0, -1).setValue(new Date()).setNumberFormat("HH:mm");
    sh.insertRowBefore(2);
  }
}

Demo:

enter image description here

  • Related