1

I am trying to hide a row when a cell is filled with "x". I have tried using scripts but they don't work.

So there are "A", "B" and "C" filled in column F.

I want the script to hide rows where "A" and "B" are filled in column F.

So if row 3 and 4 contain "A" in column F, those should be hidden.

1 Answer 1

1
function onEdit(f) {
  if (f.range.getColumn() == 6 && f.value == "A" || f.value == "B") {
    f.range.getSheet().hideRows(f.range.getRow());
  }
}
1
  • You can substitute f.range.getColumn() for f.range.columnStart and f.range.getRow() for f.range.rowStart, this leaves you with fewer API calls.
    – Jacob Jan
    Commented May 22, 2016 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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