OilEconomist
Active Member
- Joined
- Dec 26, 2016
- Messages
- 421
- Office Version
- 2019
- Platform
- Windows
Thanks in advance for your assistance.
I have two macro buttons which I have assigned to the same macro. What I would like to do is modify how the macro is run when selecting the macro. So for example, let's say:
First Macro Button
Button Name: Button1
Text within Button1 - "Download"
Second Macro Button
Button Name: Button2
Text within Button1 - "Upload"
If I select Button1, the Macro will extract the text and run the Macro in 1 Scenario, but if I select Button2, the Macro will run in an alternate scenario.
For example
I have two macro buttons which I have assigned to the same macro. What I would like to do is modify how the macro is run when selecting the macro. So for example, let's say:
First Macro Button
Button Name: Button1
Text within Button1 - "Download"
Second Macro Button
Button Name: Button2
Text within Button1 - "Upload"
If I select Button1, the Macro will extract the text and run the Macro in 1 Scenario, but if I select Button2, the Macro will run in an alternate scenario.
For example
Rich (BB code):
Sub MacroButtonRun()
Dim MacroString as text
'Get the text from the Macro button I select where the text will be MacroString
If MacroString = "Download" Then
'do this
ElseIf MacroString = "Upload" Then
'do this
Else
MsgBox "Possible "Error!"
End If
End Sub