Quote Originally Posted by duncan303 View Post
The trouble with long lists of if..thens are that once the condition is met (let say at the beginning of the list) then the program continues to chunder through all the remaining if...thens, whereas select case will exit at >end case< once the condition is met. Be careful though if your conditions are not discrete ,then you will have to arrange the cases in order of preference.

Duncan
The way around this is to nest them, and put the largest value at the top. For instance, instead of this...

if a < 5 then...
endif...
if a < 10 then...
endif...

You do this for nesting:
if a < 10 then
if a < 5 then
code here...
else
code here...
endif
endif

or this for simple and fast testing:
if a < 10 then
code here...
goto SkipTests
endif
if a < 5
code here...
endif

SkipTests:

Using this method skips all of the IF's if the most extreme condition isn't true. All of this depends upon the assumption that the value of "a" isn't changed within any of the conditional statements.