View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
SidBor SidBor is offline
external usenet poster
 
Posts: 1
Default Using SELECT...CASE with comparison operators?

Great story, Tom.
-----Original Message-----
Try ...

Select Case wigets
Case 20 To 199
MsgBox "20 To 199"
Case 200 To 399
MsgBox "200 To 399"
Case 400 To 599
MsgBox "400 To 599"
Case Else
MsgBox "Else"
End Select

BTW, the correct spelling is wiDgets ;-) The story I

heard was that it resulted from a mispelling of Midgets
published in a well respected newspaper many years ago.
People assumed it was just something they had never heard
of before, rather than believe a mispelling could ever
appear in that newspaper. Newspapers have come a long way
(down) since then.

Tom Lavedas
===========


"Toby Erkson" wrote:

Can I convert the following IF...THEN statements to a

SELECT...CASE?

if wigets = 20 AND wigets < 200 then...
if wigets =200 AND wigets < 400 then...
if wigets = 400 AND wigets < 600 then...

Excel help wasn't too helpful. I tried unsuccessfully

to use TO and IS. I
don't think I understand them very well.

Thanks,
Toby Erkson
Oregon, USA
Excel 2002 in Windows XP



.