LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 295
Default Select Case question

Hi ther, I would like to compress five different Select Case statements into
1 if possible. What I have is:
If lp_cnt = 1 Then
Select Case xxxx
Case m1L
Do some stuff
End Select
End If
If lp_cnt = 2 Then
Select Case xxxx
Case m1L, m2L
Do some stuff
End Select
End If

and so on for 5 tests of lp_cnt.
Can I just set the Case test to "m1L" or "m1L, m2L" depending in the value
of lp_cnt, and therfore have only one Select Case (the "do some stuff" bit is
reasonably long you see)? Regards, Brett
 
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
select case question Gary Keramidas Excel Programming 7 August 5th 07 11:34 PM
Select Case question Otto Moehrbach Excel Programming 5 February 28th 07 09:32 PM
select case question Gary Keramidas Excel Programming 3 April 6th 06 12:40 AM
VBA select case question Jeff Excel Discussion (Misc queries) 2 January 27th 06 03:03 AM
Select Case Question Craig Excel Programming 6 January 6th 06 09:37 AM


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