Vincent Boris Arnold said:
Can an argument be passed to a macro assigned to a
custom menu item? If so, how?
Hi Vincent,
Not sure what you want to do...
You could use the control's .Parameter or .Tag properties, and evaluate
them in your macro:
Sub TestMacroButton()
' You only need to set the .Parameter or .Tag property once;
' use the control once with the lines un-commented:
' CommandBars.ActionControl.Parameter = "Test Parameter"
' CommandBars.ActionControl.Tag = "Test Tag"
MsgBox CommandBars.ActionControl.Parameter
MsgBox CommandBars.ActionControl.Tag
End Sub
That way, you can use the same macro for several controls.
If the "argument" is some piece of information you need to get from the
user, you could use an InputBox statement in your macro.
Regards,
Klaus