Any help is greatly appreciated.
I am trying to get form responses to move over to another sheet if cell in row 5 is greater than 0. The code I am using below moves it over but adds it under the last cell that has a formula in it. Is there a modified version of this code that i can tell it to ignore formula's in cell. Also only copy over rows A:E. Thanks
function moveToAppropriateSheet(e) {
// assumes source data in sheet named Form Responses 1
// target sheet of move to named TR Requested
// test column with yes/no is col 11 or K
var ss = SpreadsheetApp.getActiveSpreadsheet();
var s = ss.getSheetByName('Query');
var r = s.getRange(s.getLastRow(),1,1,20);
var data = r.getValues();
if(data[0][4] >0) {
var row = r.getRow();
var numColumns = s.getLastColumn();
var targetSheet = ss.getSheetByName("Pending");
var target = targetSheet.getRange(targetSheet.getLastRow() + 1, 1);
targetSheet.getRange(targetSheet.getLastRow()+1,1,1,20).setValues(data);
s.deleteRow(row);
}
};