Thread: Or in a macro?
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
PCLIVE PCLIVE is offline
external usenet poster
 
Posts: 1,311
Default Or in a macro?

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

"Vick" wrote in message
...
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