Get Value module

D

DDR

Question, I am using the following expression to return a value but I can't
seem to get it to work right. I want it to GetValue -4 for anything between
..1 and .15. Any suggestions

Function GetValue(ValueIn) As String
Select Case ValueIn
Case Is < 0.15, Is > 0.1
GetValue = -4
Case Is = 0.151 <> 0.2
GetValue = -8
Case Is > 0.21
GetValue = -12.5
End Select
End Function

Thanks
 
D

Douglas J. Steele

Try:

Function GetValue(ValueIn) As String
Select Case ValueIn
Case 0.1 To 0.15
GetValue = -4
Case 0.151 To 0.2
GetValue = -8
Case Is > 0.21
GetValue = -12.5
End Select
End Function

What do you want returned if ValueIn is less than .1? You might want a Case
Else in there to handle that.
 
Top