Microsoft Excel - ctrl+shift+up arrow keys not working

Asked By Joe Harris on 17-Jan-10 03:30 PM
Can macros affect the normal  behavior of ctrl+shift+up arrow keys
Jonathan VH replied to Joe Harris on 17-Jan-10 03:47 PM
Yes, it's possible to override the default behavior of any key or keychord by using the Application.OnKey method from VBA.

Not possible to override Excel's default alt-key combinations? - J. English replied to Jonathan VH on 21-Jan-10 10:26 AM

I'm only posting because I hope that I'm wrong, but I can't seem to be able to use Application.Onkey to override Excel 2007's built-in alt key shortcuts.  I would really like to be able to customize my own alt key shortcuts to macros.  And I don't want to have to press more than one key after Alt (I know 2007 will let me do that.)
Jonathan VH replied to J. English on 21-Jan-10 12:01 PM

You could override menu accelerator Alt keychords by using the OnKey method if you first changed the Caption property of the menu.  E.g.:

Private Sub Workbook_Open()
  ActiveMenuBar.Menus(4).Caption = "Insert"
  Application.OnKey "%i", "module1.MyAltIprocedure"
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
  Application.OnKey "%i"
  ActiveMenuBar.Menus(4).Caption = "&Insert"
End Sub

Now that Excel 2007 intercepts those keychords as "Office 2003 access keys," I don't know how to disable their interception; I'm afraid it's hard-coded, and not as an event.