LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default Select Case syntax for multiple conditions ("and")?


I have a series of values (percentages) to process through a select case
statement. Cases include:
.2 ' more than 20%
.02 AND <=.2 ' between 2% and 20%
-.0199 AND <.0199 ' between +/-2%
-.0499 AND <-.0199 ' between -5% and -2%

etc.

I'm having trouble figuring out the syntax for a case range statement. I
thought I had it with
Select Case MyVar
Case (MyVar .2)
'do stuff
Case (MyVar .02) AND (MyVar <=.2)
'do stuff
Case (MyVar -.02) AND (MyVar<=.02)

but that isn't working.

What is the proper way to use a range of values that includes [greater than]
and [less than or equal to] as an AND criteria?

Thank you!
Keith

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select Case "Procedure to large" Error Little Penny[_3_] Excel Programming 1 May 9th 09 08:04 PM
"Control" plus "click" doesn't allow me to select multiple cells Ken Cooke New Users to Excel 0 September 25th 06 04:46 PM
Syntax to "OR" 3 "ISERROR" conditions Mike K Excel Worksheet Functions 6 July 22nd 06 04:18 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Why Error Message "End Select without Select Case"? GoFigure[_13_] Excel Programming 5 December 9th 05 12:26 AM


All times are GMT +1. The time now is 02:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"