Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Case 1

Status
Not open for further replies.

SteveCarrier

Programmer
Aug 6, 2002
34
0
0
CA
Hello,

I am using a select case for a project where some cases will have the same result, i.e. if x = 2 or 4 then the same lines of code are applicable.

ie.

Select Case strValue
Case 1 or 2 or 12 <------this doesn't seem to work
--do these lines of code--
Case 3 or 4 or 5 or 6
--do these lines of code
End Select

I am not sure if the syntax is right?

Thanks in advance.

Steve Carrier
 
Steve,

Try this.

Select Case strValue
Case 1 , 2 ,12 '<------this doesn't seem to work
' --do these lines of code--
Case 3 to 6
'--do these lines of code
End Select

All the best

B.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top