I have the following script (copied from the forum) to copy the last row from a form response sheet (Event) to destination sheet (sheet11). The trigger is: on form submit.
function CopyLastrowForm() {
var ss = SpreadsheetApp.getActiveSpreadsheet ();
var sourceSheet = ss.getSheetByName("Event");
var source = sourceSheet.getRange("A:AC" + sourceSheet.getLastRow());
var destSheet = ss.getSheetByName("Sheet11");
var lastRow = destSheet.getLastRow();
if (lastRow) destSheet.insertRowAfter(lastRow);
source.copyTo(destSheet.getRange(lastRow + 1,1), {contentsOnly: true});
}
Which works fine when the destination sheet rows are blank but I have (in all the rows of the destination sheet AD onwards) some arrayformulas!
So the script runs but result does not appear (I assume because it can not find lastrow on sheet11).
How should it be amended so it will copy A:AC (just values) from last row of Event! to Sheet11 in which A:AC is blank but Cols AD onwards already have formulas