Sub ListBox1_Change()
Dim macroToRun As String
With ActiveSheet.Shapes(Application.Caller).ControlFormat
macroToRun = .List(.ListIndex)
End With
RunMacroName macroToRun
ActiveSheet.Shapes(Application.Caller).ControlFormat.ListIndex = 0
End Sub
Sub RunMacroName(macroName As String)
If CBool(InStr(macroName, ".")) Then
Rem macros in userforms
Select Case macroName
Case "UserForm2.Method21"
UserForm2.Method21
Unload UserForm2
Case "UserForm2.Method22"
UserForm2.Method22
Unload UserForm2
Case "UserForm3.Method333"
UserForm3.Method333
Unload UserForm3
Case Else
End Select
Else
Rem macros in normal modules
On Error Resume Next
Application.Run macroName
On Error GoTo 0
End If
End Sub