ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   create a right click menu in excel 2002. (https://www.excelbanter.com/excel-programming/322182-create-right-click-menu-excel-2002-a.html)

Jennifer

create a right click menu in excel 2002.
 
I want to create a custom right click menu in Excel 2002. Is this possible?

Bob Phillips[_6_]

create a right click menu in excel 2002.
 
Here is a simple example to add and to remove such items

Public Sub addMenu()
removeMenu 'just in case
With Application.CommandBars("Cell")
With .Controls.Add(Type:=msoControlButton)
.BeginGroup = True
.Caption = "Routine1"
.OnAction = "Another"
End With
With .Controls.Add(Type:=msoControlButton)
.Caption = "Routine2"
.OnAction = "YetMore"
End With
End With
End Sub


Public Sub removeMenu()
On Error Resume Next
With Application.CommandBars("Cell")
.Controls("Routine1").Delete
.Controls("Routine2").Delete
End With
On Error GoTo 0
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jennifer" wrote in message
...
I want to create a custom right click menu in Excel 2002. Is this

possible?




All times are GMT +1. The time now is 12:20 PM.

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