The cells in column A are getting checked if another cell in column 11 is getting selected from a drop down list. I have a code that works right now if I am manually clicking the check box, but it will not work if the formula is applied to it. Below is my code that works if I am manually checking the checkbox in Column A. End Goal: I want to select a value from the drop down list in column 11 and it automatically put a check in the check box in column A and then my onEdit script recognize that the checkbox has been checked and it will auto archive that row.
function onEdit(event) {
// assumes source data in sheet named main
// target sheet of move to named Completed
// getColumn with check-boxes is currently set to column 1 or A
var ss = SpreadsheetApp.getActiveSpreadsheet();
var s = event.source.getActiveSheet();
var r = event.source.getActiveRange();
if(s.getName() == "ACTIVITY REPORT" && r.getColumn() == 1 && r.getValue() == true) {
var row = r.getRow();
var numColumns = s.getLastColumn();
var targetSheet = ss.getSheetByName("Archive");
var target = targetSheet.getRange(targetSheet.getLastRow() + 1, 1);
s.getRange(row, 1, 1, numColumns).moveTo(target);
s.deleteRow(row);
}
}