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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How many case can you use?

Status
Not open for further replies.

Chavito21

Programmer
Mar 26, 2003
230
US
Hi everyone,

Does anyone know if there is a limit of how many cases can you use.
I have to calculate 20 thing but I have about 150 differents kinds of items so I was thinking on using a case statment but then I will have 150 cases.

and I just wonder if there is a limit.

This is what i need to do:
I need to calculate 20 items parts of a window. We have about 1000 types of windows but of those 1000 windows they fall on about 150 window series. So depend of what windows they pick I just have to see on what seies belong and then I just need to calculate those 20 items and added to a temporary table.

any suggestions would be gratly appreciated
 
i don't think there is a limit to case statements, just remember you should cut any corners with the case statements you can and try to create funnels with your code.
Dim Number
Number = 8 ' Initialize variable.
Select Case Number ' Evaluate Number.
Case 1 To 5 ' Number between 1 and 5, inclusive.
Debug.Print "Between 1 and 5"
' The following is the only Case clause that evaluates to True.
Case 6, 7, 8 ' Number between 6 and 8.
Debug.Print "Between 6 and 8"
Case 9 To 10 ' Number is 9 or 10.
Debug.Print "Greater than 8"
Case Else ' Other values.
Debug.Print "Not between 1 and 10"
End Select



Durible Outer Casing to Prevent Fall-Apart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top