select case between 3 values

How do I write this select case
Text1 = 50
ThisValue = val(Text1)
Highvalue = 500
MedValue = 100

Select case ThisValue
 case is > MedValue and < HighValue
 msgbox "medValue"
 case is >= Highvalue
 msgbox "HighValue"
 case else
 do nothing
end select
isnoend2001Asked:
Who is Participating?
 
Martin LissConnect With a Mentor Older than dirtCommented:
If you want 100 to register as a "medValue" then change the first case as shown here.

Private Sub Form_Load()
Text1 = 50
ThisValue = Val(Text1)
HighValue = 500
MedValue = 100

Select Case ThisValue
 Case Is >= MedValue, Is < HighValue
 MsgBox "medValue"
 Case Is >= HighValue
 MsgBox "HighValue"
 Case Else
 'do nothing
End Select
End Sub

Open in new window

0
 
Martin LissOlder than dirtCommented:
Private Sub Form_Load()
Text1 = 50
ThisValue = Val(Text1)
HighValue = 500
MedValue = 100

Select Case ThisValue
 Case Is > MedValue, Is < HighValue
 MsgBox "medValue"
 Case Is >= HighValue
 MsgBox "HighValue"
 Case Else
 'do nothing
End Select
End Sub
0
 
isnoend2001Author Commented:
Seems it never got to the highValue
this seems to work
Select Case Thisvalue
 Case Is >= HighValue
  MsgBox "HighValue"
Case Is > MedValue
  MsgBox "medValue"
Case Else

 'do nothing
End Select
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.