Hot Key on Menu Bar

S

Steven

Private Sub Workbook_AddinInstall()
On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("WB Example").Delete
Set cControl = Application.CommandBars("Worksheet Menu Bar").Controls.Add
With cControl
..Caption = "WB Example"
..Style = msoButtonCaption
..OnAction = "ShowWorkbooks"
End With

I want the "x" of .Caption = "WB Example" to be the hot key.

How do I do this?

Thank you,

Steven
 
G

Gord Dibben

With cControl
..Caption = "WB E&xample" 'note the addition of the ampersand
..Style = msoButtonCaption
..OnAction = "ShowWorkbooks"
End With

Alt + x will run the ShowWorkbooks macro


Gord Dibben MS Excel MVP
 
S

Steven

Thank you, I really fee silly after that. I was putting it on the wrong
line. Time for the weekend.
 
G

Gord Dibben

I hate the weekends.

I lose my Monday-Friday Senior Rate preferred tee-times<g>


Gord
 

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