ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Another basic question... CASE with a range (https://www.excelbanter.com/excel-programming/282999-another-basic-question-case-range.html)

Phillips

Another basic question... CASE with a range
 
How would I do the following? I can not find anything about AND/OR in the
VBA help file...


if a is equal to and greater than x and if a is less than z
q=1

if a is equal to and greater than b and if a is less than c
q =2

if a is equal to and greater than e and if a is less than f
q=3

otherwise

q = 0

etc...

Thank you
Phil





Don Guillett[_4_]

Another basic question... CASE with a range
 
Have a look in vbe HELP index for Select


--
Don Guillett
SalesAid Software

"Phillips" wrote in message
news:ZKNub.249379$Fm2.259879@attbi_s04...
How would I do the following? I can not find anything about AND/OR in the
VBA help file...


if a is equal to and greater than x and if a is less than z
q=1

if a is equal to and greater than b and if a is less than c
q =2

if a is equal to and greater than e and if a is less than f
q=3

otherwise

q = 0

etc...

Thank you
Phil







Henry[_5_]

Another basic question... CASE with a range
 
Phillips,

what do you want q to be if
a is equal to and greater than x and if a is less than z
AND
a is equal to and greater than b and if a is less than c
AND
a is equal to and greater than e and if a is less than f?

Henry

"Phillips" wrote in message
news:ZKNub.249379$Fm2.259879@attbi_s04...
How would I do the following? I can not find anything about AND/OR in the
VBA help file...


if a is equal to and greater than x and if a is less than z
q=1

if a is equal to and greater than b and if a is less than c
q =2

if a is equal to and greater than e and if a is less than f
q=3

otherwise

q = 0

etc...

Thank you
Phil







Tom Ogilvy

Another basic question... CASE with a range
 
Select Case True
Case a = x and a < z
q = 1
Case a = b and a < c
q = 2
Case a = e and a < f
q = 3
Case else
q = 0
End Select

--
Regards,
Tom Ogilvy


"Phillips" wrote in message
news:ZKNub.249379$Fm2.259879@attbi_s04...
How would I do the following? I can not find anything about AND/OR in the
VBA help file...


if a is equal to and greater than x and if a is less than z
q=1

if a is equal to and greater than b and if a is less than c
q =2

if a is equal to and greater than e and if a is less than f
q=3

otherwise

q = 0

etc...

Thank you
Phil








All times are GMT +1. The time now is 12:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com