View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Assign ShortCut-key To Toggle VBA-toolbar?

' To revert to default keypress result
Application.OnKey "+^{v}", ""


This does not revert to the default keypress result. Instead, it
makes the keypress action do nothing at all. To revert to the
default, omit the second argument to OnKey.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"SIGE" wrote in message
...
Hi Tom,

I thought there was a way to do it directly but ... I got out
of the
woods with this:

Sub LaunchVBAToolbar()
Application.CommandBars("Visual Basic").Visible = True
End Sub

Sub ShortCutToVBAToolBar()
Application.OnKey "^+{v}", "LaunchVBAToolbar" 'ctrl + shift
+ v
End Sub

Sub ResetShortCutVBAToolbar()
' To revert to default keypress result
Application.OnKey "+^{v}", ""
End Sub

Thanks, Sige


"NOSPAM" to be removed for direct mailing...

*** Sent via Developersdex http://www.developersdex.com ***