Or in a macro?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to use an or type statement in a macro? For example I'm using
an event macro on 8 cells. If one of those cells = No a row is unhidden, this
works fine, the problem I'm running into, is that I want to have the row
hidden if the all of those cells = yes or is blank. Is there an or statement
I can use or do I need to do a bunch of if statements, or am I just missing
something very obvious?

Thanks
 
Possibly something like this:

If WorksheetFunction.CountIf(Range("A1:H1"), "No") > 0 _
Then
'Code if "No" exists
Else
'Code if "No" does not exist
End If


HTH,
Paul
 
Back
Top