PC Review


Reply
Thread Tools Rate Thread

Assign macro to custom menu

 
 
=?Utf-8?B?SGFybGV5?=
Guest
Posts: n/a
 
      15th Nov 2006
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 With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      15th Nov 2006
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

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      15th Nov 2006
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" <(E-Mail Removed)> wrote in message
news:89A04CF5-06E2-4189-8DD9-(E-Mail Removed)...
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom menu Items. Unable to assign the right sub to each button RBAiras Microsoft Outlook Calendar 1 6th Apr 2009 02:00 PM
macro does not assign to menu? Robert24 Microsoft Excel Misc 2 2nd Oct 2008 04:39 AM
How to re-assign macro to Toolbar or Menu? aushknotes Microsoft Word Document Management 7 3rd Apr 2008 12:39 AM
Assign shortcut key to custom menu in Word =?Utf-8?B?R2FuZXRo?= Microsoft Word New Users 2 22nd Apr 2004 03:56 AM
Assign macro to custom button P Sims Microsoft Excel Worksheet Functions 1 11th Aug 2003 06:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:49 PM.