i went there could not understand how it relates to my question, this is what i would like to know if this is proper syntax for the case select statement:
select case var1
case "red","orange","green"
case Else
case "dirt"
end select
how is expressionlist-n performed?
like this: case "red","orange","green"
or like this: case "red,orange,green"
how is expressionlist-n performed?
As explained in the link I gave you:
A comma delimited list of one or more expressions.
Select Case var1
Case "red", "orange", "green"
MsgBox "red or orange or green"
Case "dirt"
MsgBox "dirt"
Case Else
MsgBox "Yet another case"
End Select
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Select Case gives better performance [than multiple if statements] if there are a lot of conditions, but the difference is minimal for just a few conditions.
[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.