0

So this is the code that I'm using for the script that I found;

function onOpen() {
  var s = SpreadsheetApp.getActive().getSheetByName('Todo');
  s.showRows(1, s.getMaxRows());

  s.getRange('D:D')
    .getValues()
    .forEach( function (r, i) {
    if (r[0] == 'X') 
      s.hideRows(i + 1);
    });
}

But I want it to hide the row if column D is X OR Y. I am not a programmer, and I'm very new to this. I have googled this to death but I'm not making any headway. Please help.

0

Try changing

if (r[0] == 'X') 

to

if (r[0] == 'X' || r[0] == 'Y' ) 
1
  • That did it. Thank you so much! – Ron Jul 17 '19 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.