MacroEcon1337
Board Regular
- Joined
- Mar 16, 2017
- Messages
- 65
Goal: I'd like to click a command button, located on a user form, and have a message box appear with the name of the command button object (that was just clicked).
Note 1: this is intended for Active X Buttons, not form buttons.
Note 2: The command button is located in a UserForm
Note 3: None of the below worked...
Dim ButtonName as String
ButtonName = ActiveForm.Shapes(Application.Caller).Name
MsgBox ButtonName
Dim ButtonName as String
ButtonName = Application.Caller
MsgBox ButtonName
Dim ButtonName As String
ButtonName = Application.Caller
MsgBox ButtonName
Dim ButtonName As String
ButtonName = Application.Caller.Name
MsgBox ButtonName
Any thoughts or suggestions are appreciated!
Note 1: this is intended for Active X Buttons, not form buttons.
Note 2: The command button is located in a UserForm
Note 3: None of the below worked...
Dim ButtonName as String
ButtonName = ActiveForm.Shapes(Application.Caller).Name
MsgBox ButtonName
Dim ButtonName as String
ButtonName = Application.Caller
MsgBox ButtonName
Dim ButtonName As String
ButtonName = Application.Caller
MsgBox ButtonName
Dim ButtonName As String
ButtonName = Application.Caller.Name
MsgBox ButtonName
Any thoughts or suggestions are appreciated!