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
- 4758 reads
Recent comments
5 years 50 weeks ago
6 years 36 weeks ago
6 years 48 weeks ago
6 years 51 weeks ago
7 years 1 day ago
7 years 5 weeks ago
7 years 13 weeks ago
7 years 14 weeks ago
7 years 14 weeks ago
7 years 14 weeks ago