http://support.microsoft.com/default.aspx?scid=kb;en-us;166755
File Title: Customizing Menu Bars, Menus, and Menu Items in Microsoft(R)
Excel 97
File Name: WE1183.EXE
File Size: 58041 bytes
File Date: 06/20/97
Keywords: kbfile kbappnote
Description: This Application Note can help you learn techniques for writing
Visual Basic(R) for Applications code to customize menus in Microsoft Excel
97. This Application Note contains code examples that you can use with the
following elements: menu bars, menus, menu items, submenus, and shortcut
menus.
http://support.microsoft.com/?id=213209
XL2000: Sample Macros that Customize and Control Shortcut Menus
http://support.microsoft.com/?id=162878
XL97: Sample Macros That Customize and Control Shortcut Menus
Previous post by Andy Wiggins:
This file might be a help:
http://www.bygsoftware.com/examples/zipfiles/PopUpMenuDemo.zip
It's in the "Menu Routines" section on page:
http://www.bygsoftware.com/examples/examples.htm
Demonstrates how to create and implement a popup menu.
The workbook covers two areas:
* Creating a popup menu
* Using the Right_Click event
The code is open and commented.
--
Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"
-----
Previous Post by Ron de Bruin
If you mean the menu if you right click on a cell then try this
Sub AddToCellDropDown()
Dim CellDropDown As CommandBar
Dim MyDropDownItem As CommandBarControl
RemoveFromCellDropDown
Set CellDropDown = Application.CommandBars("Cell")
With CellDropDown.Controls.Add(Type:=msoControlButton, before:=1)
.Caption = "Try me"
.Style = msoButtonIconAndCaption
.FaceId = 59
.OnAction = ThisWorkbook.Name & "!Your_macro"
.Tag = "MyDropDownItem"
End With
End Sub
Sub RemoveFromCellDropDown()
Dim MyDropDownItem As CommandBarControl
Set MyDropDownItem =
Application.CommandBars.FindControl(Tag:="MyDropDownItem")
If Not MyDropDownItem Is Nothing Then
MyDropDownItem.Delete
End If
Set MyDropDownItem = Nothing
End Sub
Sub Your_macro()
MsgBox "Hi there."
End Sub
--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)