![]() ![]() The default macro will probably say something like “Rectangle1_Click,” but that’s not what you want. To associate your shape with your macro, right-click your shape in Excel and click “Assign Macro…”Īs long as your macro isn’t a private macro the name of the macro should appear in a window that looks like this: Now you’re ready to assign the macro you created earlier to the shape you just created. It’s loaded with VBA shortcuts to help you make your own macros like this one - we’ll send a copy, along with our Big Book of Excel VBA Macros, to your email address below. If you have trouble understanding or remembering it, our free VBA Developer Kit can help. Make powerful macros with our free VBA Developer Kit You can color the shape however you want and you can even add effects and enter text into your shape.Īfter designing it, my final shape looks like this: I made a rectangle shape so it looks like a button. ![]() The shape can be whatever you like and you can put it wherever you want. Now, go over to your spreadsheet and insert a shape, like this: Just don’t put the word Private in front of the word Sub or pass your macro an argument and you’ll usually be okay. ![]() The important thing is that your macro cannot be a private macro. Obviously your macro can be more complicated than this! This macro changes the background color of whatever cell you have selected to yellow. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |