LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Expanding Menu items in VBA

I have a simple menu set that loads a menu item ("Menu Item") and then
creates two items below it (Sub Item 1 and Sub Item 2). See Code Below

Menu Item
Sub Item 1
Sub Item 2

I now want to create sub items for each of the two items
Menu Item
Sub Item 1
Sub Item 1.1
Sub Item 1.2
Sub Item 2
Sub Item 2.1
Sub Item 2.2

How do I expand the code below to incorporate the new tier of sub menu items.

Thanks EM

NewMenu.Caption = "&Menu Item"

'Set First Tier of Menue Items
'First Menu Item
Set MenuItem = NewMenu.Controls.Add _
(Type:=msoControlButton)
With MenuItem
.Caption = "&Sub Item 1"
.FaceId = 590
'Call macro when chosen
.OnAction = "Macro 1"
End With

'Second Menu Item
Set MenuItem = NewMenu.Controls.Add _
(Type:=msoControlButton)
With MenuItem
.Caption = "&Sub Item 2"
.FaceId = 591
'Call macro when chosen
.OnAction = "Macro 2"
End With
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Menu items Pietro Excel Discussion (Misc queries) 2 March 1st 07 10:41 AM
Adding menu items Claud Balls Excel Programming 2 January 19th 05 03:54 AM
Menu items added with menu item editor in older versions Michael Hoffmann Excel Discussion (Misc queries) 2 January 7th 05 01:40 PM
submenu help (how to create arrow for expanding menu) dave k Excel Programming 1 January 3rd 05 10:51 AM
Sub Menu Items pauluk[_72_] Excel Programming 1 July 27th 04 12:23 PM


All times are GMT +1. The time now is 07:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"