Thread: Select Case
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JP[_4_] JP[_4_] is offline
external usenet poster
 
Posts: 897
Default Select Case

Try this:

Function range(incw) As String


Select Case incw
Case 0
range = "None"
Case incw 0 And incw <= 5
range = "Moderate"
Case Is 5
range = "Extreme"
End Select
End Function


HTH,
JP

On Jan 22, 12:47*pm, wrote:
Hi,
I am having some trouble with Select Case. *I have a bunch of ifelse
statements that would be run faster as a select case, but i cant get
the syntax. *I want something like:

Function range(incw) as string

*Select Case incw
* * * Case is 0
* * * * * * * * range="None"
* * * Case is 0 And <=5 * * * * * ' This is the part im having
trouble with
* * * * * * * * range="Moderate"
* * * Case is 5
* * * * * * * * range="Extreme"
*End Select
*End Function

Thanks