![]() |
Shortcut key
Hi everyone,
I created a new menu with the command below: Application.OnKey key:="^{t}", procedu="Test" Application.OnKey key:="^{u}", procedu="Update" Set myMenuBar = CommandBars.ActiveMenuBar Set NewMenu = myMenuBar.Controls.Add (Type:=msoControlPopup, temporary:=True) NewMenu.Caption = "Data Send" Set ctrl1 = NewMenu.Controls.Add(Type:=msoControlButton, ID:=1) ctrl1.Caption = "Test" ctrl1.TooltipText = "Test" ctrl1.Style = msoButtonCaption ctrl1.OnAction = "Test" Set ctrl2 = NewMenu.Controls.Add(Type:=msoControlButton, ID:=1) ctrl2.Caption = "Update" ctrl2.TooltipText = "Update" ctrl2.Style = msoButtonCaption ctrl2.OnAction = "Update" This code opens e main menu called "Data Send" and 2 submenus called "Test" & "Update". With Ctrl+t I start the "Test" macro and with Ctrl+u "Update" macro. But my target is to put an underscore to drilldown the Database menu like under "D" (e.g Alt+F to drilldown "File" menu) then underscore "t" and "u" for submenus. Any suggestions??? |
Shortcut key
Hi Hande,
Use an ampersand for the underscore that indicates Alt+character to invoke the menu, or once within a menu the character to invoke a menu item. If you want to see an ampersand then double the amersand. ctrl2.Caption = "&Update && More" --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Hande" wrote in message ... Hi everyone, I created a new menu with the command below: Application.OnKey key:="^{t}", procedu="Test" Application.OnKey key:="^{u}", procedu="Update" Set myMenuBar = CommandBars.ActiveMenuBar Set NewMenu = myMenuBar.Controls.Add (Type:=msoControlPopup, temporary:=True) NewMenu.Caption = "Data Send" Set ctrl1 = NewMenu.Controls.Add(Type:=msoControlButton, ID:=1) ctrl1.Caption = "Test" ctrl1.TooltipText = "Test" ctrl1.Style = msoButtonCaption ctrl1.OnAction = "Test" Set ctrl2 = NewMenu.Controls.Add(Type:=msoControlButton, ID:=1) ctrl2.Caption = "Update" ctrl2.TooltipText = "Update" ctrl2.Style = msoButtonCaption ctrl2.OnAction = "Update" This code opens e main menu called "Data Send" and 2 submenus called "Test" & "Update". With Ctrl+t I start the "Test" macro and with Ctrl+u "Update" macro. But my target is to put an underscore to drilldown the Database menu like under "D" (e.g Alt+F to drilldown "File" menu) then underscore "t" and "u" for submenus. Any suggestions??? |
All times are GMT +1. The time now is 03:37 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com