#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Right click menus

Is it possible to customize the right-click drop-down menus in Excel 2007?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default Right click menus

You can use code similar to the following.


Sub CreateMenuItem()
Dim RCMenu As Office.CommandBar
Dim Ctrl As Office.CommandBarButton
Set RCMenu = Application.CommandBars("Cell")
Set Ctrl = RCMenu.Controls.Add(Type:=msoControlButton, temporary:=True)
With Ctrl
.BeginGroup = True
.Caption = "Click Me"
.OnAction = "'" & ThisWorkbook.Name & "'!RunProc"
End With
End Sub

Sub RunProc()
MsgBox "hello world"
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"guild0001" wrote in message
...
Is it possible to customize the right-click drop-down menus in Excel 2007?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Right click menus

Yes that does somthing along the right lines. I am a novice with code and
want to add "Paste Values" to a right click.
I was hoping to just be able to just add it to the right-click menu in much
the same way as you add things to the toolbars but I presume this is not
possible.

"Chip Pearson" wrote:

You can use code similar to the following.


Sub CreateMenuItem()
Dim RCMenu As Office.CommandBar
Dim Ctrl As Office.CommandBarButton
Set RCMenu = Application.CommandBars("Cell")
Set Ctrl = RCMenu.Controls.Add(Type:=msoControlButton, temporary:=True)
With Ctrl
.BeginGroup = True
.Caption = "Click Me"
.OnAction = "'" & ThisWorkbook.Name & "'!RunProc"
End With
End Sub

Sub RunProc()
MsgBox "hello world"
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"guild0001" wrote in message
...
Is it possible to customize the right-click drop-down menus in Excel 2007?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default Right click menus

Use code like

Sub AAA()
Application.CommandBars("Cell").Controls.Add ID:=370, temporary:=True
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"guild0001" wrote in message
...
Yes that does somthing along the right lines. I am a novice with code and
want to add "Paste Values" to a right click.
I was hoping to just be able to just add it to the right-click menu in
much
the same way as you add things to the toolbars but I presume this is not
possible.

"Chip Pearson" wrote:

You can use code similar to the following.


Sub CreateMenuItem()
Dim RCMenu As Office.CommandBar
Dim Ctrl As Office.CommandBarButton
Set RCMenu = Application.CommandBars("Cell")
Set Ctrl = RCMenu.Controls.Add(Type:=msoControlButton,
temporary:=True)
With Ctrl
.BeginGroup = True
.Caption = "Click Me"
.OnAction = "'" & ThisWorkbook.Name & "'!RunProc"
End With
End Sub

Sub RunProc()
MsgBox "hello world"
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"guild0001" wrote in message
...
Is it possible to customize the right-click drop-down menus in Excel
2007?



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Right click menus

Thanks that works fine!

"Chip Pearson" wrote:

Use code like

Sub AAA()
Application.CommandBars("Cell").Controls.Add ID:=370, temporary:=True
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"guild0001" wrote in message
...
Yes that does somthing along the right lines. I am a novice with code and
want to add "Paste Values" to a right click.
I was hoping to just be able to just add it to the right-click menu in
much
the same way as you add things to the toolbars but I presume this is not
possible.

"Chip Pearson" wrote:

You can use code similar to the following.


Sub CreateMenuItem()
Dim RCMenu As Office.CommandBar
Dim Ctrl As Office.CommandBarButton
Set RCMenu = Application.CommandBars("Cell")
Set Ctrl = RCMenu.Controls.Add(Type:=msoControlButton,
temporary:=True)
With Ctrl
.BeginGroup = True
.Caption = "Click Me"
.OnAction = "'" & ThisWorkbook.Name & "'!RunProc"
End With
End Sub

Sub RunProc()
MsgBox "hello world"
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"guild0001" wrote in message
...
Is it possible to customize the right-click drop-down menus in Excel
2007?




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
HOW DO I EDIT RIGHT CLICK MENUS IN EXCEL? Matt Swift Excel Discussion (Misc queries) 7 December 6th 06 10:13 AM
Right-Click Menus - Customizing s boak Excel Discussion (Misc queries) 6 October 9th 06 08:04 PM
Menus / Links associated with right-mouse-click lost! adnessoz Excel Discussion (Misc queries) 3 August 24th 06 11:41 PM
Right-click menus elaine Excel Worksheet Functions 1 January 24th 06 07:26 PM
customizable right click menus aerobul Excel Worksheet Functions 1 March 19th 05 01:26 AM


All times are GMT +1. The time now is 10:10 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"