I need to reset checkboxes to FALSE (Unchecked) and also delete all notes from defined sheets.
Also need a script that deletes all notes from a Google sheet (all sheets)
I tried combining numerous different scripts.
https://webapps.stackexchange.com/questions/115076/how-to-run-script-on-multiple-google-sheet-tabs
Re-set checkboxes to false - Google Apps Script -- The problem with this script is that is turns cells with a value of 1 into cells that say "FALSE"
function ResetCheckBoxesAndClearNotesOnDefinedSheets(){
var tabs = [
'Checkboxes 1',
'Checkboxes 2',
'Checkboxes 3',
'Another Checkbox tab',
'Yet another checkbox tab'
];
//LOOP THROUGH TABS LISTED ABOVE
var ss=SpreadsheetApp.getActiveSpreadsheet();
for (var i = 0; i < tabs.length; i++) {
var sheet=ss.getSheetByName(tabs[i]);
//CLEAR NOTES ON TABS LISTED ABOVE
sheet.clearNotes();
// CLEAR CHECKBOXES ON TABS LISTED ABOVE
var dataRange = sheet.getRange('A:I');
var values = dataRange.getValues();
for (var i = 0; i < values.length; i++) {
for (var j = 0; j < values[i].length; j++) {
if (values[i][j] == true) {
values[i][j] = false; // Modified
}
}
}
dataRange.setValues(values);
}//end of sheets loop.
}
ACTUAL RESULTS: -It does not loop through the pages and delete the notes. It also does not loop through and change all checkboxes in the tabs to unchecked.. and it sometimes replaces a "1" with a FALSE
EXPECTED RESULTS: -Reset all checkboxes on defined sheets -Clear all notes on Defined sheets (or entire Spreadsheet)
How about this modification?
Modification points:
i
is used at bothfor (var i = 0; i < tabs.length; i++) {
andfor (var i = 0; i < values.length; i++) {
.i
offor (var i = 0; i < tabs.length; i++) {
is not increased every 1.It does not loop through the pages and delete the notes.
.for (var k = 0; k < tabs.length; k++) {var sheet=ss.getSheetByName(tabs[k]);
.==
is used for comparing the boolean.it sometimes replaces a "1" with a FALSE
.===
.Modified script:
Please modify as follows.
From: To:And
From: To:Reference:
If I misunderstood your question, please tell me. I would like to modify it.