Hello, looking for opinions? Is there a good reason for choosing a form control over a shape to assign a macro? Is one more reliable than the other? I believe I had trouble with shapes before any thoughts her responses are appreciate it thank you!
Thanks for the response. I like ActiveX too. For the shapes I think I might have been trying to use some as labels only and some had macros so I would click on the non-macro shape in error and get confused lol. I think that's why I moved to form buttons and used plain cells as labels. Geesh! ActiveX controls I go nuts and try to be too fancy and go down rabbit wholes ? and get stuck sometimes.I assume you are talking about using a shape the same way you would use a button, where the only thing you want to do is click it to run a macro. There is not much difference. I can't think of a clear benefit of using a Forms buttons vs. a shape.
(I personally prefer ActiveX controls to either one of those because the code features are more powerful, although they can't be used on a Mac.)
I am not following your terminology here, but it's quite simple to use the same code to invoke by clicking a shape, clicking an ActiveX control, or using a shortcut key.Module scripts can be activated by a shortcut Key or a Shape or also assigned to a Activex Button.
A script in a Activex button as far as I know cannot be activated by a shortcut Key.
Private Sub CommandButton1_Click()
DoSomeWork
End Sub
Public Sub DoSomeWork()
' Code here to perform the desired action
End Sub
Very helpful, thank you.I know you have already clicked the solved button but:
I like Module scripts that I assign to a shape.
Module scripts can be activated by a shortcut Key or a Shape or also assigned to a Activex Button.
A script in a Activex button as far as I know cannot be activated by a shortcut Key.
A Module script is one like you get when you run the recorder.
In a activex button enter something like this:
If your module script is named "Hello"
Enter Call Hello
to run the script in a activex button
Thank you, this was a good reminder and helpful tooI am not following your terminology here, but it's quite simple to use the same code to invoke by clicking a shape, clicking an ActiveX control, or using a shortcut key.
In a Worksheet module containing the ActiveX control:
In a Standard module:VBA Code:Private Sub CommandButton1_Click() DoSomeWork End Sub
Sub DoSomeWork can be the assigned macro for a Shape, and it can be given a keyboard shortcut. It can also, of course, be called from any other code.VBA Code:Public Sub DoSomeWork() ' Code here to perform the desired action End Sub