I have a command button on a word document that when it is clicked, I need it to run a macro that I have already recorded. Can anyone tell me the code for doing that? Thanks in advance!
On the Control Toolbox toolbar, click the "Design Mode" icon (the very first one) to enter design mode. Then right-click on your button and select "View code" from the popup menu. You'll be taken to the commandbutton1_click (name may be different) sub, where you can enter the code to be executed. You could put a simple call to your existing macro here, or copy the macro code into this event handler.
Then turn design mode off, and give it a click. Rob
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.