Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default Right click menu

Code to create the new shortcut menu item:

Add lines to the Workbook_Open procedure as follows:

If necessary, make an empty line above the existing code, and enter as the
first line the variable declaration:

Dim NewControl as CommandBarControl

The next line of code, which can be entered below your shortcut key code,
tells Excel that the variable is a new item (or control) to be added to the
right-click menu of a cell:

Set NewControl = Application.CommandBars("Cell").Controls.Add

Now some code to describe the new item:

With NewControl
.Caption = "Insert Date"
.OnAction = "Module1.MacroName"
.BeginGroup = True
End With

Pls do rate

"ewagz" wrote:

Is there a way to add an item (Macro) to the right cleick menu? The macro
will be calling a userform.

Any help would be appreciated!
--
EW - Analyst

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
Right Click Menu mpeplow[_19_] Excel Programming 2 July 31st 06 04:28 PM
Add menu item to right-click menu [email protected] Excel Programming 1 July 15th 06 10:32 AM
right click menu PT SPORT CONTRUCTION CO.,LTD Excel Programming 2 October 13th 04 11:18 AM
Adding a menu item right click menu when clicking on a single. Andoni[_28_] Excel Programming 0 September 2nd 04 10:23 PM
Adding menu to the mouse right click pop-up menu Jack Excel Programming 1 February 12th 04 05:23 AM


All times are GMT +1. The time now is 07:05 PM.

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

About Us

"It's about Microsoft Excel"