?
Solved

select case between 3 values

Posted on 2012-08-30
3
Medium Priority
?
510 Views
Last Modified: 2012-08-30
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
0
Comment
Question by:isnoend2001
  • 2
3 Comments
 
LVL 50

Expert Comment

by:Martin Liss
ID: 38351052
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
 
LVL 50

Accepted Solution

by:
Martin Liss earned 2000 total points
ID: 38351064
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
 

Author Closing Comment

by:isnoend2001
ID: 38351251
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The main intent of this article is to make you aware of ‘Exchange fail to mount’ error, its effects, causes, and solution.
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question