Assign macro to custom menu

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I wrote a macro to create a custom menu for a specific workbook. This menu is
not needed for any other workbook and is deleted upon closing. How do I
assign, via code, a macro to run when this button is clicked?

Thank you
 
In the code that creates the menu item, use the onaction property to assign
it to a macro. If you are fuzzy on the code, if after you create the menu,
then turn on the macro recorder and do Tools->customize - leave the dialog
displayed and right click on the bottm and assign a macro. Then drop the
dialog and turn off the macro recorder. Look at the recorded code.
 
You set the OnAction property of the control to your macro when creating it.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 

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

Back
Top