VBA to change Button Macro assignment

K

Ken Loomis

I would like to change or remove a macro assignment to buttons.

I use this to change the text of a shape that I use as a button:

ActiveSheet.Shapes("Rectangle 5").Select
Selection.Characters.Text = "Mark Anomolies"

How would I change or remove the macro assignment to that button?

TIA,
Ken
 
N

Norman Jones

Hi Ken,

To change assignment, try:

ActiveSheet.Shapes("Rectangle 5")..OnAction = "MyNewMacro"


To Remove the assignment:

ActiveSheet.Shapes("Rectangle 5")..OnAction = ""
 
L

L. Howard Kittle

Hi Ken,

Try something like this.

To remove only:
ActiveSheet.Shapes("Rectangle 5").OnAction = ""

To change:
ActiveSheet.Shapes("Rectangle 5").OnAction = "New Macro Name"

HTH
Regards,
Howard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top