Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Drop down menus
Can anyone tell me how to get a drop down menu (say called 'Feeds') on the
Standard toolbar between the Data and Window drop downs and from that menu items so that I can 'attach' them to macros Many thanks James |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Drop down menus
James,
Paste something like this in a code module: 'CreateMyMenu will create the menu 'DeleteMyMenu deletes the menu 'Test is a sub executed in the menu item Sub CreateMyMenu() Dim cmdBar As CommandBar Dim cmdBarMenu As CommandBarControl Dim cmdBarMenuItem As CommandBarControl Set cmdBar = Application.CommandBars("Worksheet Menu Bar") Set cmdBarMenu = cmdBar.Controls.Add(Type:=msoControlPopup, Befo=cmdBar.Controls("Window").Index) cmdBarMenu.Caption = "M&yMenu" cmdBarMenu.Tag = "MINE" Set cmdBarMenuItem = cmdBarMenu.Controls.Add With cmdBarMenuItem .Caption = "&Macro1" .OnAction = "Test" .Tag = "MINE" End With End Sub Sub DeleteMyMenu() Dim c As CommandBarControl On Error Resume Next For Each c In Application.CommandBars.FindControls(Tag:="MINE") c.Delete Next c End Sub Sub test() MsgBox "Hello, World" End Sub -- Hope that helps. Vergel Adriano " wrote: Can anyone tell me how to get a drop down menu (say called 'Feeds') on the Standard toolbar between the Data and Window drop downs and from that menu items so that I can 'attach' them to macros Many thanks James |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Drop down menus
Spot on Vergel
Thanks for that James "Vergel Adriano" wrote: James, Paste something like this in a code module: 'CreateMyMenu will create the menu 'DeleteMyMenu deletes the menu 'Test is a sub executed in the menu item Sub CreateMyMenu() Dim cmdBar As CommandBar Dim cmdBarMenu As CommandBarControl Dim cmdBarMenuItem As CommandBarControl Set cmdBar = Application.CommandBars("Worksheet Menu Bar") Set cmdBarMenu = cmdBar.Controls.Add(Type:=msoControlPopup, Befo=cmdBar.Controls("Window").Index) cmdBarMenu.Caption = "M&yMenu" cmdBarMenu.Tag = "MINE" Set cmdBarMenuItem = cmdBarMenu.Controls.Add With cmdBarMenuItem .Caption = "&Macro1" .OnAction = "Test" .Tag = "MINE" End With End Sub Sub DeleteMyMenu() Dim c As CommandBarControl On Error Resume Next For Each c In Application.CommandBars.FindControls(Tag:="MINE") c.Delete Next c End Sub Sub test() MsgBox "Hello, World" End Sub -- Hope that helps. Vergel Adriano " wrote: Can anyone tell me how to get a drop down menu (say called 'Feeds') on the Standard toolbar between the Data and Window drop downs and from that menu items so that I can 'attach' them to macros Many thanks James |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating Drop-down menus with subset drop-down menus | Excel Worksheet Functions | |||
Drop down menus | Excel Worksheet Functions | |||
Drop Down Menus | Excel Discussion (Misc queries) | |||
Drop-Down Menus | Excel Discussion (Misc queries) | |||
Drop down menus | Excel Discussion (Misc queries) |