Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default a better way

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default a better way

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)

"RobcPettit" wrote in message
oups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default a better way

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

Bob Phillips wrote:
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)

"RobcPettit" wrote in message
oups.com...
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


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



All times are GMT +1. The time now is 03:28 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"