Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, is it possible to add an item to the right mouse-click menu?
|
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello Silkworm, Yes it is. Which of the right click menus did you have in mind? Sincerely, Leith Ros -- Leith Ros ----------------------------------------------------------------------- Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846 View this thread: http://www.excelforum.com/showthread.php?threadid=49587 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for replying. I should've been more clear. What I have in mind
is to write some VBA code, and when a user right click on a cell, have the right-click menu display the option to run the script. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello Silkworm, The following macros Add or Remove your custom control from the contex menu (right click) for Worksheet cells. Once you add your control, i will remain on the menu until you run the remove macro. You run thi when you close your program. Otherwise the macro will not be availabl to other Workbooks eventhough the control still appears on the menu Change the Caption property to what your control does, and the OnActio property to the name of the macro to run. _____________________________ Code ------------------- Public Sub AddToContextMenu() Dim C Dim cmdNew As CommandBarButton 'Don't add the Menu if it exists. For Each C In Excel.CommandBars("cell").Controls If C.Caption = "Change Cell and Font Colors" Then Exit Sub End If Next C Set cmdNew = Excel.CommandBars("cell").Controls.Add With cmdNew .Caption = "Change Cell and Font Colors" .OnAction = "ChangeCellColor" .BeginGroup = True End With End Sub Public Sub RemoveFromContextMenu() On Error Resume Next With CommandBars("cell").Controls("Change Cell and Font Colors") .BeginGroup = False .Delete End With End Sub ------------------- _____________________________ Sincerely, Leith Ros -- Leith Ros ----------------------------------------------------------------------- Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846 View this thread: http://www.excelforum.com/showthread.php?threadid=49587 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding Sub Menu Item to Current Custom Menu | Excel Programming | |||
How to delete item on right click menu? | Excel Discussion (Misc queries) | |||
Add item to sheet right-click menu? | Excel Programming | |||
Adding a menu item right click menu when clicking on a single. | Excel Programming | |||
Adding menu to the mouse right click pop-up menu | Excel Programming |