Solution to "ListBox change calls a different macros"

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
| Attachment | Size |
|---|---|
| ListBoxMacro.xlsm | 20.15 KB |
| ListBoxMacro2.jpg | 35.85 KB |
| ListBoxMacro.jpg | 47.3 KB |
- Almir's blog
- Login or register to post comments
- 5087 reads


Recent comments
6 years 36 weeks ago
7 years 22 weeks ago
7 years 34 weeks ago
7 years 37 weeks ago
7 years 38 weeks ago
7 years 43 weeks ago
7 years 51 weeks ago
8 years 1 day ago
8 years 1 day ago
8 years 2 days ago