Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 260
Default Case Statements

I have combobox1. There can be 52 different possible
values in the combobox. How do I set up a case statement
that will say... If combobox1.value = 1 then a if 2 then
b if 3 then c and so on....


Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Case Statements

Hi Todd,

Select Case ComboBox1.Text
Case "1"
'/ do a
Case "2"
'/ do b
Case Else
'/ didn't match
End Select

That is, unless you can figure out a way to make your process simpler (ie,
less than 52 cases).

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Todd Huttenstine wrote:
I have combobox1. There can be 52 different possible
values in the combobox. How do I set up a case statement
that will say... If combobox1.value = 1 then a if 2 then
b if 3 then c and so on....


Thank you


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Case Statements

Hi Todd
have a look at the VBA help :-)

try something like
'...
Select Case combobox1.value
case 1
'do something for 1
case 2
'do something for 2
'...
case Else
'don't know what to do
end select
'...



--
Regards
Frank Kabel
Frankfurt, Germany


Todd Huttenstine wrote:
I have combobox1. There can be 52 different possible
values in the combobox. How do I set up a case statement
that will say... If combobox1.value = 1 then a if 2 then
b if 3 then c and so on....


Thank you

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
IF Statements to Select Case??? Walter Excel Discussion (Misc queries) 2 December 2nd 09 08:00 PM
Case Statements in Excel 2003 Alex Excel Discussion (Misc queries) 3 April 3rd 08 10:34 PM
Changing multiple cell text from lower case to upper case Patti Excel Discussion (Misc queries) 2 January 4th 08 08:35 PM
Change the text from lower case to upper case in an Excel work boo dave01968 Excel Discussion (Misc queries) 2 December 9th 05 09:09 AM
Limits on Case Statements Todd Huttenstine Excel Programming 4 April 14th 04 08:32 PM


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