Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to run macros from combobox selection
Hello.
I've tried everything I can think of using the code below and cannot get even MsgBox to show according to the selection. If anyone has a working example, I'd be most appreciative! Example one: Private Sub Worksheet_Change(ByVal Target As Range) Dim Addx As String Dim Rng As Range Addx = Target.Validation.Formula1 Set Rng = Range(Right(Addx, Len(Addx) - 1)) If Target.Address = "$A$1" Then Select Case Target.Value Case Is = Rng.Cells(1, 1) 'First Drop Down Item 'Call RandD MsgBox "Macro 01" Case Is = Rng.Cells(2, 1) 'Second Drop Down Item 'Call MacroB MsgBox "Macro 02" Case Is = Rng.Cells(3, 1) 'Third Drop Down Item 'Call MacroC MsgBox "Macro 03" End Select End If End Sub ============================ Example two: Sub combo1_Change() Select Case combo1.Value Case "This" MsgBox "This" Case "That" MsgBox "That" Case "The Other Thing" MsgBox "The Other Thing" End Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ComboBox last selection | Excel Programming | |||
fill combobox depending on selection from another combobox | Excel Discussion (Misc queries) | |||
Combobox items determined by the selection in another combobox | Excel Programming | |||
Combobox Selection | Excel Programming | |||
Combobox selection | Excel Programming |