ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sub-Menu Listings (https://www.excelbanter.com/excel-programming/400110-sub-menu-listings.html)

thall600

Sub-Menu Listings
 
Is it possible to create sub-menu lists in Xcel? For example, when you click
on the "Start" menu, you can then click on "Programs", then "Office", then
"Xcel". I am trying to create something similar. Thanks for any input.

Gord Dibben

Sub-Menu Listings
 
Yes, possible.

See John Walkenbach's MenuMaker site with a downloadable sample workbook.

http://www.j-walk.com/ss/excel/tips/tip53.htm


Gord Dibben MS Excel MVP


On Fri, 26 Oct 2007 17:05:00 -0700, thall600
wrote:

Is it possible to create sub-menu lists in Xcel? For example, when you click
on the "Start" menu, you can then click on "Programs", then "Office", then
"Xcel". I am trying to create something similar. Thanks for any input.



Bob Phillips

Sub-Menu Listings
 
This should get you going

Sub MultiLevelMenus()
Dim oCb As CommandBar
Dim oCtl1 As CommandBarPopup
Dim oCtl2 As CommandBarPopup
Dim oCtl3 As CommandBarPopup
Dim oCtlBtn As CommandBarButton

Set oCb = Application.CommandBars("Worksheet Menu Bar")
With oCb
Set oCtl1 = .Controls("Tools").Controls.Add( _
Type:=msoControlPopup, _
temporary:=True)
oCtl1.Caption = "Level1"
With oCtl1
Set oCtlBtn = .Controls.Add( _
Type:=msoControlButton)
oCtlBtn.Caption = "Level1 Button1"
oCtlBtn.FaceId = 161
oCtlBtn.OnAction = "myLevel1Button1Macro"
With oCtl1
Set oCtl2 = .Controls.Add( _
Type:=msoControlPopup)
oCtl2.Caption = "Level2"
With oCtl2
Set oCtlBtn = .Controls.Add( _
Type:=msoControlButton)
oCtlBtn.Caption = "Level2 Button1"
oCtlBtn.FaceId = 161
oCtlBtn.OnAction = "myLevel2Button1Macro"
Set oCtl3 = .Controls.Add( _
Type:=msoControlPopup)
oCtl3.Caption = "Level3"
With oCtl3
Set oCtlBtn = .Controls.Add( _
Type:=msoControlButton)
oCtlBtn.Caption = "Level3 Button1"
oCtlBtn.FaceId = 161
oCtlBtn.OnAction = "myLevel3Button1Macro"
End With
End With
End With
'etc.
End With
End With
End Sub

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"thall600" wrote in message
...
Is it possible to create sub-menu lists in Xcel? For example, when you
click
on the "Start" menu, you can then click on "Programs", then "Office", then
"Xcel". I am trying to create something similar. Thanks for any input.





All times are GMT +1. The time now is 03:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com