ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel VBA - submenu in a short cut (https://www.excelbanter.com/excel-programming/310600-excel-vba-submenu-short-cut.html)

bforster1[_13_]

Excel VBA - submenu in a short cut
 

I have the following code that creates a dropdown menu when I righ
click in the spreadsheet

Sub CreateShortcut()
Dim myBar As CommandBar
Dim myItem As CommandBarControl

DeleteShortcut
Set myBar = CommandBars.Add _
(Name:="MyShortcut", Position:=msoBarPopup, Temporary:=True)

Set myItem = myBar.Controls.Add(Type:=msoControlButton)
With myItem
.Caption = "&Go To.."
.OnAction = "ShowFormatNumber"
.FaceId = 1554
End With


What I want to do is create a sub menu attached to the menus tha
originally display. See example below

Level 1 Go To
Leve 2 Budget

Any suggestions?

--
bforster
-----------------------------------------------------------------------
bforster1's Profile: http://www.excelforum.com/member.php...fo&userid=1177
View this thread: http://www.excelforum.com/showthread.php?threadid=26171



All times are GMT +1. The time now is 04:16 PM.

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