Sub-Menu Items - How Do I Add To My Custom Menu?

J

JessiRight77

Hello.

I figured out how to put a "custom" menu item on my personal.xls
worksheet, and attach a macro to it. What I actually want, however,
is to add menu SUB-items that cascade from my main custom menu. I do
not see where I can edit the one menu item to add additional sub-items.


Does anyone know how to do this?

Thanks,
Jessi
 
F

Franz Verga

Nel post *[email protected]* ha scritto:
Hello.

I figured out how to put a "custom" menu item on my personal.xls
worksheet, and attach a macro to it. What I actually want, however,
is to add menu SUB-items that cascade from my main custom menu. I do
not see where I can edit the one menu item to add additional
sub-items.


Does anyone know how to do this?

Thanks,
Jessi


Hi Jessi,

You have to go in customization mode (right click on a toolbar, Customize),
then click on the tab Commands, in the Category search for New Menu and from
the Commands section drag the item New Menu & drop inside your custom menu.
Then you can customize as you want.

--
(I'm not sure of names of menues, option and commands, because
translating from the Italian version of Excel...)

Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy
 
B

Bob Phillips

Here is an example that puts a sub-menu on the Tools menu with two
sub-menus.

Dim oCb As CommandBar
Dim oCtl As CommandBarPopup
Dim oCtlBtn As CommandBarButton

Set oCb = Application.CommandBars("Worksheet Menu Bar")
With oCb
Set oCtl = .Controls("Tools").Controls.Add( _
Type:=msoControlPopup, _
temporary:=True)
oCtl.Caption = "myButton"
With oCtl
Set oCtlBtn = .Controls.Add( _
Type:=msoControlButton, _
temporary:=True)
oCtlBtn.Caption = "myMacroButton"
oCtlBtn.FaceId = 161
oCtlBtn.OnAction = "myMacro"
End With
With oCtl
Set oCtlBtn = .Controls.Add( _
Type:=msoControlButton, _
temporary:=True)
oCtlBtn.Caption = "myMacroButton2"
oCtlBtn.FaceId = 161
oCtlBtn.OnAction = "myMacro2"
End With
'etc.
End With

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top