I have been searching all day trying to find out how to do this and get close but never to a finished state.
What I am trying to do is on active spreadsheet, look at Sheet "Happy". If a cell in Colum G contains "Closed" I want to copy the cells between range A:K for that row to sheet "Sad". Once the copy is done and the data is moved I want to then delete the whole row on sheet "Happy" that the data was copied from.
IF cell = closed, than copy to sheet and delete, else nothing.
I will run this script every 5 min which I can do with triggers.
Any help would be greatly appreciated.
Here is what I tried so far
function Copy() {
var sss = SpreadsheetApp.getActive()
var ss = sss.getSheetByName('Happy');
var range = ss.getRange('A:k');
var data = range.getValues();
var tss = SpreadsheetApp.getActive();
var ts = tss.getSheetByName('Sad:');
var valuesToCopy = ss.getRange(2,2,100).getValues();
ts.getRange(2,ts.getLastRows()+1,valuesToCopy.length,1).setValues(valuesToCopy);