Sort of Newbie so please be kind.
I have been working on this code for hours and I have been making progress ... I think lol ... but I now seem to be stuck.
CodePudding user response:
Hiding Rows in column B if they are checkboxes
The function assumes a one row and one column offset for the checkboxes in columnB from the checkboxes in columnA and the hides rows as long as it finds checkboxes in the rows. When there is not a checkbox it stops
function onMyEdit(e) {
const sh = e.range.getSheet();
if (sh.getName() == 'Sheet0' && e.range.columnStart == 1 && e.value == "TRUE") {
if(e.range.offset(1, 1).getDataValidation().getCriteriaType() == "CHECKBOX") {
let r = e.range.offset(1,1).getRow();
let i = 0;
do{
sh.hideRows(r i );
}while(e.range.offset(1 i,1).getDataValidation().getCriteriaType() == "CHECKBOX")
}
}
}
Demo: