Excel Shortcut (right click) Menus

P

Phil

Hi,
How do I modify a short cut - right click - menu?
I would like to insert the 'Edit' into the menu that comes
up if you highlight a column then right click on it.
Many Thanks in advance
 
F

Frank Kabel

Hi
find some code below for adding an entry to the contextmenu:

Sub Add_Item()
Dim New_Entry As Object
Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True)
On Error Resume Next
New_Entry.Controls("My message").Delete
On Error Goto 0

With New_Entry
.Caption = "My message"
.OnAction = "Message"
End With
End Sub


Sub Message()
MsgBox "Now you code yould start"
End Sub

Sub Delete_Item()
Dim myControl As CommandBarButton
For Each myControl In CommandBars("Cell").Controls
If myControl.Caption = "My message" Then
myControl.Delete
End If
Next
End Sub
 
Top