Hello Matrixknow,
A Control Toolbox ComboBox can have multiple columns. The macro to be run can be inserted in a column next to the item that will be displayed. When a choice is made, the adjacent column's string (the macro name) is pulled and executed.
Macro to Load ComboBox:
Change the Items and Macros to what you need.
Sub LoadComboBox1()
Dim I As Long
Dim Items
Dim Macros
Items = Array("Item 1", "Item 2", "Item 3")
Macros = Array("Macro 1", "Macro2", "Marco 3")
With ActiveSheet.ComboBox1
.Clear
For I = 0 To UBound(Items)
.AddItem Items(I)
.List(I, 1) = Macros(I)
Next I
End With
End Sub
ComboBox1 Code:
Private Sub ComboBox1_Click()
With ComboBox1
Application.Run .List(.ListIndex)
End With
End Sub
Sincerely,
Leith Ross
Bookmarks