View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Mark[_36_] Mark[_36_] is offline
external usenet poster
 
Posts: 39
Default Context sensitive menu

Thanks alot! works like a charm. :-)


"Frank Kabel" wrote in message
...
Hi Mark
try the following procedures (they add/delete an entry to the cell
context menu):


Sub Add_Item()
Dim New_Entry As Object
Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True)
With New_Entry
.Caption = "My message"
.OnAction = "Message"
End With
End Sub

Sub Message()
MsgBox "My message is here - put code at this place"
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


--
Regards
Frank Kabel
Frankfurt, Germany

Mark wrote:
Hi NG

Is there someway to add items to the right mouse menu in Excel?
And perhaps even do it dynamically, so that one get some sort of
context sensitive menu?

Regards
Mark