The onEdit function below for adding back checkboxes which are accidentally deleted works, but is waaaay too slow (and the list so far only contains half the ranges). The further down the list of ranges the deletion takes place, the longer it takes for the code to 'react' and replace the deleted checkbox (I suppose that is obvious to everybody except myself)
function onEdit(e) {
var rangeList = SpreadsheetApp.getActive().getSheetByName('Sheet1').getRangeList(['E6:E7','E10:E11','E15:E16','E19:E20','E24:E25','E28:E29','E33:E34','E37:E38','E42:E43','E46:E47','E51:E52','E55:E56','H6:H7','H9:H10','H12:H13','H15:H16','H18:H19','H21:H22','H24:H25','H27:H28','H30:H31','H33:H34','H36:H37','H39:H40','H42:H43','H45:H46','H48:H49','H51:H52','H54:H55','H57:H58',]);
for (var i=0; i<rangeList.getRanges().length; i++ ) {
var range = rangeList.getRanges()[i];
for (var j=0; j<range.getValues().length; j++ ) {
var value = range.getValue()[j];
var values = range.getValues();
for ( var val in values ) {
if( values[val] != 'TRUE' && values[val] != 'FALSE' ) {
range.insertCheckboxes();
}
}
}
}
}
Is there anyway to get the job done faster?
Please note: I really dont know what I am doing (the code above was a major headache and I got plenty of help), so please please be explicit. Thank you.