Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Assigning Multiple Macros to One ComboBox Control

Private Sub UserForm_Initialize()

ComboBox1.AddItem "Item 1" 'ListIndex = 0
ComboBox1.AddItem "Item 2" 'ListIndex = 1
ComboBox1.AddItem "Item 3" 'ListIndex = 2

End Sub

Private Sub ComboBox1_Change()

Select Case ComboBox1.ListIndex
Case 0
MsgBox "Item 1 was selected"
Case 1
MsgBox "Item 2 was selected"
Case 2
MsgBox "Item 3 was selected"
Case Else
MsgBox "Error"
End Select

End Sub


--
Michael J. Malinsky


"Chas" wrote in message
...
Hi,
Need some guidance on this one.
Have a combobox with three selections. Also have three
macros, one for each combobox selection. I've tried
selecting the combobox and assigning the macro but this
only assigns one macro to the whole combobox. So only the
macro assigned runs no matter which item is selected in
the combobox.
How do I assign a different macro to each combobox
selection?

Thanks in advance for your help!
Chas



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
form control combobox Gail Excel Discussion (Misc queries) 7 October 2nd 09 07:27 PM
Control ToolBox ComboBox Steve D Excel Discussion (Misc queries) 1 July 1st 09 05:17 PM
Disable and enable dropdown combobox(Form Control) Vinod[_2_] Excel Discussion (Misc queries) 0 November 6th 07 07:30 PM
HELP PLEASE..Inserting combobox (ActiveX control) makes workbook c Inquiringmind Excel Discussion (Misc queries) 0 February 10th 07 11:01 AM
Assigning the name of a userform/control to a changing string Brad Patterson Excel Programming 2 July 16th 03 11:00 PM


All times are GMT +1. The time now is 10:16 AM.

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"