#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 63
Default Or in a macro?

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Or in a macro?

hi.
Post your current code.

Regards
FSt1

"Vick" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.misc
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 01:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"