Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default select case multiple conditions

Is is possible to use a select case arrangement with more than one
conditional variable because if I nest it using another select case or an if
statement the code gets much longer and is not so easy to follow.

eg I tried something like this but couldn't get it to work
select case var_a, var_b
case var_a=x, var_b10
case var_a=y, var_b10
case var_a=x, var_b<11
etc
end case

Any alternative suggestions welcome

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default select case multiple conditions

On Jun 18, 7:54 am, Chris G wrote:
Is is possible to use a select case arrangement with more than one
conditional variable because if I nest it using another select case or an if
statement the code gets much longer and is not so easy to follow.

eg I tried something like this but couldn't get it to work
select case var_a, var_b
case var_a=x, var_b10
case var_a=y, var_b10
case var_a=x, var_b<11
etc
end case

Any alternative suggestions welcome

Thanks


select case true
case var_a=x and var_b10
case var_a=y and var_b10
case var_a=x and var_b<11
etc
end case

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default select case multiple conditions

I like it - very clever Tom. Thanks

"T Lavedas" wrote:

On Jun 18, 7:54 am, Chris G wrote:
Is is possible to use a select case arrangement with more than one
conditional variable because if I nest it using another select case or an if
statement the code gets much longer and is not so easy to follow.

eg I tried something like this but couldn't get it to work
select case var_a, var_b
case var_a=x, var_b10
case var_a=y, var_b10
case var_a=x, var_b<11
etc
end case

Any alternative suggestions welcome

Thanks


select case true
case var_a=x and var_b10
case var_a=y and var_b10
case var_a=x and var_b<11
etc
end case

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/

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
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
select multiple records in database given conditions MayFestivalRon Excel Worksheet Functions 1 May 9th 08 09:49 PM
Changing multiple cell text from lower case to upper case Patti Excel Discussion (Misc queries) 2 January 4th 08 08:35 PM
End Select without Select Case, Block If without End If errors Atreides Excel Programming 12 November 17th 06 05:10 PM


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

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"