0

In Google Sheets, I have data in the A column from A3. Whenever I enter data into the A1 cell it should get appended to the last cell of column A. Let's say I have data from A3 to A10 and in the B column from B3 to B30. So when I add data in the A1 cell it should get appended to A11 even though B11 have data.

I tried this script but it is not working when B11 has data:

function onEdit(e) {
  var sheet = e.source.getActiveSheet();
  var row = e.range.getRow();
  var col = e.range.getColumn();
  
  if (col == 1 && row == 1) {
    var lastRow = sheet.getLastRow();
    var value = e.value;
    sheet.getRange(lastRow+1, col).setValue(value);
  }
}

  • 1
    If my understanding of your question is correct, I thought that this thread will be an answer to your question. https://stackoverflow.com/q/17632165 – Tanaike Apr 09 '23 at 09:12

0 Answers0