Re: using between 2 numbers in a case select

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Nikos Yannacopoulos (nyannacoREMOVETHISBIT_at_in.gr)
Date: 10/22/04


Date: Fri, 22 Oct 2004 12:18:40 +0300

Julie,

That approach will work nicely with continuous intervals, but what if there
are gaps in between?

Rick,

The syntax is:

Select Case i
Case Is < 50000
    MsgBox "i"
Case 50001 To 250000
    MsgBox "ii"
Case 500001 To 1000000
    MsgBox "iii"
Case 2000000 To 2300000
    MsgBox "iv"
End Select

"JulieD" <JulieD@hctsReMoVeThIs.net.au> wrote in message
news:OSMnAbBuEHA.1356@TK2MSFTNGP11.phx.gbl...
> Hi Rik
>
> you don't need to do the between ... if the value is less than 50000 it
will
> meet the first condition, then for the value to get to the second
condition
> it must be greater than (or equal to) 50000 ... so you only need to test
if
> it is less than 250000.
>
> Select Case i
> Case Is < 50000
> MsgBox "i"
> Case Is < 250000
> MsgBox "ii"
> End Select
>
> Cheers
> JulieD
>
>
> "rikking" <rikking.1eis9b@excelforum-nospam.com> wrote in message
> news:rikking.1eis9b@excelforum-nospam.com...
> >
> > Hello,
> > I was wondering if someone could help, I'm writing a case select where
> > the first case is <50000, and the next one is between 50000 and 250000.
> > I can't seem to figure out how to do between 2 numbers with a case
> > select.
> > any help with this would be greatly appreciated
> >
> > Cheers in advance
> >
> > Rik
> >
> >
> > --
> > rikking
> > ------------------------------------------------------------------------
> > rikking's Profile:
> > http://www.excelforum.com/member.php?action=getinfo&userid=9709
> > View this thread:
http://www.excelforum.com/showthread.php?threadid=271471
> >
>
>



Relevant Pages

  • Re: if and + formula
    ... frequent syntax would be ... you won't get to test the second condition at all if the first condition is ... Secondly the results you are returning are both text strings, ... another cell for a day ...
    (microsoft.public.excel.misc)
  • Re: if and + formula
    ... omit the result_if_condition_false parameter, ... frequent syntax would be ... you won't get to test the second condition at all if the first condition is ... Secondly the results you are returning are both text strings, ...
    (microsoft.public.excel.misc)
  • Re: errors in sample mex files?
    ... Praetorian wrote: ... Rick wrote: ... Either this file has multiple errors (and should never have ... What's the point in testing the first condition again? ...
    (comp.soft-sys.matlab)
  • Re: installed sendmail but where is it ??
    ... Rick wrote: ... >> according to whereis. ... There is no reason for ...
    (linux.redhat.misc)
  • Re: A Question of design.
    ... Rik wrote: ... ALTER TABLE `user_books` ADD UNIQUE ( ... Hi Rick. ... unique uids, and if there were, it wouldn't be for very long at all. ...
    (comp.lang.php)