I am on basics of appscript and learning it progressively with the help of this community. Any help on below will be appreciated.
I am trying to design a script which hides and unhides rows on change of selection and for that I got a solution from question posted at below link.
Google Sheet Hide/Unhide Rows Using Appscrit Unhide
Below is the code given in above link
function onEdit(e) { const sh = e.range.getSheet(); const rg = e.source.getRangeByName("NamedRange1"); const sr = rg.getRow(); const sc = rg.getColumn(); const er = sr + rg.getHeight() - 1; const ec = sc + rg.getWidth() - 1; if (sh.getName() == "Sheet3" && e.range.columnStart >= sc && e.range.columnStart <= ec && e.range.rowStart >= sr && e.range.rowStart <= er && e.value) { //e.source.toast("Flag1") const sh2 = e.source.getSheetByName("Sheet2"); const vs = sh2.getDataRange().getValues(); vs.forEach((r, i) => { if (r.every(e => e == '')) { if (e.value == "A") { sh2.hideRows(i + 1); } else { sh2.showRows(i + 1) } } }); } } The code is given proper result but I want a bit modification in the same. The unhide command of the code unhides all the rows of the sheet, however I want the code to unhide all the rows except first row of the sheet.
Any help on above will really be appreciated.