LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default long IF statement with lots of OR's

Hi

Is there a smarter way to write this kind of code ?

If InputParameter1 = "A" And (InputParameter2 = "X" Or InputParameter2 = "Y" Or
InputParameter2 = "Z" and so on) Then
[...]

My intuition would go for something like this:
If InputParameter1 = "A" And InputParameter2 In ("X", "Y", "Z", and so on)

but that doesn't seem to be correct.

Any ideas ?


René




 
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
Long If Statement Michael Excel Worksheet Functions 5 July 21st 08 05:08 PM
Excel cut and paste row takes a long time. Lots of formulas. Chris Excel Discussion (Misc queries) 1 January 17th 08 06:42 PM
very long statement Frank Drost Excel Discussion (Misc queries) 0 January 18th 06 08:47 PM
IF statement too long KSH Excel Discussion (Misc queries) 6 November 3rd 05 07:28 PM
Long IF Statement rmitchell87 Excel Discussion (Misc queries) 2 October 2nd 05 03:50 AM


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

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

About Us

"It's about Microsoft Excel"