Solution to "ListBox change calls a different macros"

Almir's picture

Regarding: "http://excelexperts.com/listbox-and-list" and: "http://excelexperts.com/more-macros-listbox-items": How change in listbox value calls a different macro.

Create ActiveX ListBox and create a list of macros, like in the example file attached.

Put this code into your worksheet part:

Private Sub ListBox1_Click()

If ListBox1 = "Macro1" Then
Call Macro1
End If

If ListBox1 = "Macro2" Then
Call Macro2
End If

If ListBox1 = "Macro3" Then
Call Macro3
End If

If ListBox1 = "Macro4" Then
Call Macro4
End If

If ListBox1 = "Macro5" Then
Call Macro5
End If

End Sub

ListBox change calls different macro
AttachmentSize
ListBoxMacro.xlsm20.15 KB
ListBoxMacro2.jpg35.85 KB
ListBoxMacro.jpg47.3 KB