View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Spencer Hutton[_3_] Spencer Hutton[_3_] is offline
external usenet poster
 
Posts: 17
Default add to shortcut menu

my mistake, i meant when a cell is Right Clicked.
"Frank Kabel" wrote in message
...
Hi
as starting point some code:
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

--
Regards
Frank Kabel
Frankfurt, Germany

Spencer Hutton wrote:
i am trying to make a custom shortcut menu for when any cell in the
activesheet is clicked, but i am not entirely sure how to do this.

this is what i have so far to change the font:

Sub FormatFontShow()
Application.Dialogs(xlDialogFormatFont).Show
End Sub

but i don't know how to make a new shortcut menu with this item when
you right click on any cell. TIA.