Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default 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






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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






Reply
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
Very basic VBA question. Cerberus Excel Discussion (Misc queries) 1 July 21st 08 04:30 PM
basic question M121385 New Users to Excel 4 May 6th 08 06:22 PM
Basic question...sorry jen the runner Excel Worksheet Functions 11 September 18th 07 12:12 AM
Basic question plittle Excel Discussion (Misc queries) 1 May 23rd 06 03:49 PM
Too Basic A Question dave Excel Programming 6 October 26th 03 03:57 PM


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

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

About Us

"It's about Microsoft Excel"