I've got a script that moves a row of data (well only 1 cell actually) from one sheet to another, upon a certain condition being met (in this case it's onEdit when Col17 = "Yes"). I'm selecting the data to move using:
var target = targetSheet.getRange(targetSheet.getLastRow() + 1, 1);
s.getRange(row, 1, 1, 1).copyTo(target);
Where 's' is Active Sheet and 'targetSheet' is the Destination Sheet.
This works perfectly when my destination sheet is blank.
However, I want to fill the other columns of my destination sheet with data, and have this script operate only in Column A. As soon as I add data to any other column, my script inserts the copied value below any existing data regardless of whether or not there is data in Column A.
E.g. I have 1,2,3 in Cells A1, A2 and A3 then A,B,C,D,E in Cells B1,B2,B3,B4 and B5. I run my script. New data is inserted into A6 (the first totally empty row). I want it to go to A4 (the first empty row in Col A).