I want to make a reset button that I assign script to. The goal of the script is to set checkboxes in a range of cells (not continuous) to false. The column beside those same cells would have an if statement for the checkbox. I get an error when I run this code. In the new formula I get =IF(RangeList= TRUE, TRUE, FALSE). RangeList should be cell f6, f7, etc.
Here is what I have for my code.
function myFunction() {
`var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(“Curriculum Rubric”);
var rangeToReset = sheet.getRangeList([“F6:F11”, “F17:F22”, “F28:F32”, “F38:F44”, “F50:F61”, “F67:F76”, “F82:f90”, “F96:F102”]);
var rangeToAddFormula = sheet.getRangeList([“G6:G11”, “G17:G22”, “G28:G32”, “G38:G44”, “G50:G61”, “G67:G76”, “G82:G90”, “G97:G103”]);
rangeToAddFormula.setFormula(“=IF(” + rangeToReset + “= TRUE, TRUE, FALSE)”);
rangeToReset.setValue(false);“
}
I’m not sure how to get specific elements, F6, F7, F8, F9, etc.
Thank you for any help.
enter image description here
I tried building a string for the formula. See the code line: rangeToAddFormula.setFormula(
What should have happened is that it would refill the formulas down:
=IF(F6= TRUE, TRUE, FALSE) =IF(F7= TRUE, TRUE, FALSE)
etc.
What is happening is that it is putting in
=IF(RangeList= TRUE, TRUE, FALSE)
How do I replace RangeList with the specific cells?
Beth Stoudt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.