Ok so I have some code here that I think should work, but doesn't. I want it so that if the first column of any sheet has the status "complete" it pushes to the "Completed Tasks" sheet. However for some reason it doesn't work. I'm not sure if it's a syntactical problem or not.
function onEdit(event) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var s = event.source.getActiveSheet();
var r = event.source.getActiveRange();
if((s.getName() == "Beau" || "Derek" || "Jay" || "Steven" || "Terence" || "Victor") && r.getColumn() == 1 && r.getValue() == "Complete") {
var row = r.getRow();
var numColumns = s.getLastColumn();
var targetSheet = ss.getSheetByName("Completed Tasks");
var target = targetSheet.getRange(targetSheet.getLastRow() + 1, 1);
s.getRange(row, 1, 1, numColumns).moveTo(target);
s.deleteRow(row);
}
}
Here is the link to my sheet. As you can see on the "Beau" sheet there is some information, but it hasn't pushed it anywhere.
https://docs.google.com/spreadsheets/d/1_HQJ2UK6R3QTLY9oeVe-PIaZngPN1luQAz633taE4Oo/edit?usp=sharing
I would also like it so that if information is entered onto the front "To Do" sheet, it checks the "Assigned To" cell and pushes it to the correct person's sheet. We had it much simpler before but by separating out the sheets it has made it very complicated for me (With my little experience)
Thank you!
Logger.log("my variable value is: " + variableName);
, and then VIEW the LOGS. You can also add aLogger.log('It ran!');
inside the condition code to see if the condition tested true. – Alan Wells