Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a comboBox embeded on a worksheet. The comboBox is from the "Form" menu. It shows four items in the dropdown list. My problem is how do I assign macros to these four items, so when one is selected an assigned macro would run. Also, how do I refer to this comboBox in my codes? Thanks for your help. Kind Regards |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a comboBox embeded on a worksheet. The comboBox is from the "Form" menu. It shows four items in the dropdown list. My problem is how do I assign macros to these four items, so when one is selected an assigned macro would run. Also, how do I refer to this comboBox in my codes? Thanks for your help. Like this: - Rightclick the dropdown - select Attach macro - hit the New button Paste in this code between the Sub ... and End Sub lines that are automatically inserted: With ActiveSheet.DropDowns(Application.Caller) Select Case .Value Case "1" MsgBox "You selected item 1)" Case "2" MsgBox "You selected item 2)" Case "3" MsgBox "You selected item 3)" Case "4" MsgBox "You selected item 4)" End Select End With Regards, Jan Karel Pieterse Excel MVP www.jkp-ads.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Thanks for your help. This works. Thanks. -----Original Message----- Hi, I have a comboBox embeded on a worksheet. The comboBox is from the "Form" menu. It shows four items in the dropdown list. My problem is how do I assign macros to these four items, so when one is selected an assigned macro would run. Also, how do I refer to this comboBox in my codes? Thanks for your help. Like this: - Rightclick the dropdown - select Attach macro - hit the New button Paste in this code between the Sub ... and End Sub lines that are automatically inserted: With ActiveSheet.DropDowns(Application.Caller) Select Case .Value Case "1" MsgBox "You selected item 1)" Case "2" MsgBox "You selected item 2)" Case "3" MsgBox "You selected item 3)" Case "4" MsgBox "You selected item 4)" End Select End With Regards, Jan Karel Pieterse Excel MVP www.jkp-ads.com . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
fill combobox depending on selection from another combobox | Excel Discussion (Misc queries) | |||
Combobox | Excel Discussion (Misc queries) | |||
combobox into another combobox | New Users to Excel | |||
ComboBox | Excel Programming | |||
combobox | Excel Programming |