0

I have been struggling to get my Apps Script to work consistently. I am trying to copy row from one sheet to another. my script knows to copy row based on dropdown in column 9 this part works flawlessly every time. The inconsistency comes when I ask it to find first empty cell in column"A" of corresponding page and copy there.

Sample sheet has a read me page for more specifics on what I am trying to do. https://docs.google.com/spreadsheets/d/1befqsGQvbPfn0XTGrygLOGcrUIMrICUagJVH0S-2rDw/edit?usp=sharing

I tried to use last row but that will not do as I am copying data into rows that are not empty. Hence the need for the copy to go to empty cell in column "A"

  • Try using [getColumnHeight()](https://stackoverflow.com/a/55425107/7215091) – Cooper Jun 01 '22 at 21:04
  • Exact copy of [I am having a script issue where .copyto isn't finding the correct row to copy to](https://support.google.com/docs/thread/165681602?msgid=165727493) that has an answer. – doubleunary Jun 02 '22 at 06:34

1 Answers1

1

The answer in Google Sheets community solves the issue using the appendRows_() utility function:

    appendRows_(targetSheet, values, 1);
    sheet.deleteRows(e.range.rowStart, 1);
doubleunary
  • 13,842
  • 3
  • 18
  • 51