Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Assign macro to custom menu

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Assign macro to custom menu

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.

--
Regards,
Tom Ogilvy


"Harley" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Assign macro to custom menu

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)

"Harley" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro does not assign to menu? Robert24 Excel Discussion (Misc queries) 2 October 2nd 08 04:39 AM
Assign macro name to menu command w/o using workbook name Blight_Pete Excel Discussion (Misc queries) 0 August 3rd 06 10:48 PM
Assign macro to right click menu ? Richard[_35_] Excel Programming 1 August 25th 05 03:49 PM
Remove the filename when assign a macro to a menu command. OKLover[_2_] Excel Programming 4 July 12th 05 06:24 PM
How to assign macro to menu button? deko[_3_] Excel Programming 6 May 3rd 05 07:07 PM


All times are GMT +1. The time now is 12:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"