a better way

R

RobcPettit

Hi, I was wondering if theres a better way to check certain criteria.
For instance;
A2 can = Playing or Winner or loser or Unknown or Suspended. A1 can
equal 1 or 2 or 3 or 4 or 5. I use ifs to ask certain questians.
If a1 = 1 and a2 = Playing then.......
elseif a1 = 2 and a2 = playing then......
elseif a1 > 2 and a2 = playing then
elseif a1 > 2 and a2 = Winner then ...... etc. As you can see, alot of
if's and debugging. Is there a better way to ask these questions.
Regards Robert
 
B

Bob Phillips

I would go with

Select Case Range("A2").Value
Case "Playing":
Select Case Range("A1").Value
Case 1: ...
etc.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 
R

RobcPettit

Thanks for a quick reply Bob, Ill read up on this and give it ago.
Regards Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top