I'm new to this whole script coding thing and am having trouble refining a script I currently have running. I found the code I'm using here. I was able to modify it to run on column E of my worksheet and it works beautifully on that one sheet.
I'd like to have it run on multiple sheets in the workbook but I'm not familiar enough with the coding language/syntax to make it work. I've tried pulling bits of code from other posts with a similar goal, only to have the script error on a part of the code that was working previously.
The code is as follows:
function onOpen() {
var s = SpreadsheetApp.getActive()
.getSheetByName('BV421');
s.showRows(1, s.getMaxRows());
s.getRange('E:E')
.getValues()
.forEach(function (r, d) {
if (r[0] !== '' && r[0].toString()
.charAt(0) == 0) s.hideRows(d + 1)
});
}
I know the problem (at least in part) is with the .getSheetByName('BV421') but I'm not sure how to get it to select multiple sheets. I have other sheets (e.g., Alexafluor488, PerCP, FITC, etc.) that I would like to run the script on but not all of the sheets in the workbook.
Any help you can provide would be greatly appreciated!