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)