Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
menu bars
i've created a menu on my toolbar of type Worksheet Menu Bar. Now,
want to use the same exact menu bars and I understand that I need t use of type Chart Menu Bar. However, my menu bar has somewhere aroun 15 options and thus you can imagine that there is quite a bit of code I don't want to have to copy and paste the same exact code to use fo my chart menu bar. Is it possible to combine the code definition of th menu bar to work in both types of menu bars? Thanks in advance -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
menu bars
i've created a menu on my toolbar of type Worksheet Menu Bar. Now, I
want to use the same exact menu bars and I understand that I need to use of type Chart Menu Bar. However, my menu bar has somewhere around 15 options and thus you can imagine that there is quite a bit of code. I don't want to have to copy and paste the same exact code to use for my chart menu bar. Is it possible to combine the code definition of the menu bar to work in both types of menu bars? Thanks in advance. you can use the index of the Commandbars for both menubars: Sub MyMenu() Dim intI As Integer For intI = 1 To 2 On Error Resume Next Application.CommandBars(intI).Controls("My Button").Delete On Error GoTo 0 With Application.CommandBars(intI).Controls.Add(Tempora ry:=True) .Style = msoButtonCaption .Caption = "My Button" .OnAction = "MyMakro" End With Next intI End Sub Sub MyMakro() MsgBox "Hello world" End Sub -- Regards Melanie Breden - Microsoft MVP für Excel - http://excel.codebooks.de (Das Excel-VBA Codebook) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ribbon / menu bars | Excel Discussion (Misc queries) | |||
How to identify active Menu Bars | Excel Discussion (Misc queries) | |||
Delete custom menu bars | Setting up and Configuration of Excel | |||
Disappearing Tool and menu bars | Excel Discussion (Misc queries) | |||
Lost all my menu bars and tool bars | Excel Discussion (Misc queries) |