ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   adding macro to right mouse click menu (https://www.excelbanter.com/excel-discussion-misc-queries/52970-adding-macro-right-mouse-click-menu.html)

JimB

adding macro to right mouse click menu
 
I know how to add macros to toolbars and menus, but I would like to add a
macro to the right mouse click menu in Excel. Can anyone tell me how to
accomplish this? Thanks and regards


Chip Pearson

adding macro to right mouse click menu
 
This can be done only with code.

With
Application.CommandBars("Cell").Controls.Add(tempo rary:=True)
.Caption = "Click Me"
.OnAction = "'" & ThisWorkbook.Name & "'!MyMacroName"
End With


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"JimB" wrote in message
...
I know how to add macros to toolbars and menus, but I would like
to add a
macro to the right mouse click menu in Excel. Can anyone tell
me how to
accomplish this? Thanks and regards





All times are GMT +1. The time now is 06:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com