[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Select in range in VBScript

Posted on 2000-03-25
1
Medium Priority
?
280 Views
Last Modified: 2006-11-17
How do I select within a range in VBScript?

*************************
Dim intInteger

intInteger = 5

Select Case intInteger
     Case 1 to 5
            'do something
     Case 6 to 10
            'do something else
End select

******************

Also tried with Cint(intInteger) and tried many strategies like
1 or 2 or 3 or 4 or 5

and

>0 & <6

etc.

Did we just get shafted on this one, or is something I'm missing?

Thanks

ic
0
Comment
Question by:ic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
mahno earned 60 total points
ID: 2661008
Hi ic,

U can select using

Dim intInteger

intInteger = 5

If intInteger >= 1 And intInteger <= 5 Then
            MsgBox "do something"
ElseIf intInteger >= 6 And intInteger <= 10 Then
            MsgBox "do something else"
End If

---Or---

Select Case intInteger
     Case 1,2,3,4,5
            MsgBox "do something"
     Case 6,7,8,9,10
            MsgBox "do something else"
End select

Hope that helps,
  mahno

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Six Sigma Control Plans

650 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