I've read through countless different posts that are similar to this topic, but have yet to find something that really solves the exact issue I'm looking to fix.
My script currently reads the value of a particular cell, and depending on it, hides X amount of rows beneath. I've seen scripts written where any time the text appears in the column, that specific row (with the matching text) hides -- but let me be clear this is NOT what I'm looking for.
The first piece of my code works flawlessly, including all of the else if statements. However, when trying to add in a separate If statement based on DIFFERENT cell, I can't seem to get that to work.
I need to keep this in one OnEdit I believe, otherwise it would be super simple?
I think I am close, but hoping someone can point me in the right direction.
function onEdit(e){
if(e.range.getA1Notation() === 'B13' && e.range.getSheet().getName()=='Temp1'){
if(e.value=='Base1') {
e.range.getSheet().showRows(14,4);
} else if(e.value=='Base2') {
e.range.getSheet().hideRows(15,3);
}
else if(e.value=='Base3') {
e.range.getSheet().hideRows(15,3);
}
else if(e.value=='Base4') {
e.range.getSheet().showRows(14,3);
}
else if(e.value=='Base5') {
e.range.getSheet().hideRows(17,1);
}
else if(e.value!== "") {
e.range.getSheet().hideRows(14,4);
}
if(e.range.getA1Notation() === 'B5' && e.range.getSheet().getName()=='Temp1'){
if(e.value=='Base10') {
e.range.getSheet().showRows(10,2);
}
}
}
}