use the OnKey method to assign a macro procedure to a single keystroke or any combination of Ctrl, Shift, and Alt with another key. : Application OnKey « Application « VBA / Excel / Access / Word






use the OnKey method to assign a macro procedure to a single keystroke or any combination of Ctrl, Shift, and Alt with another key.

 
     Sub AssignDown()
         Application.OnKey "{Down}", "DownTen"
     End Sub
     Sub DownTen()
         ActiveCell.Offset(10, 0).Select
     End Sub
     Sub ClearDown()
         Application.OnKey "{Down}"
     End Sub

 








Related examples in the same category

1.Change the Down Arrow Key
2.Restore Down Arrow key
3.Deactivate ^c
4.Reactivate ^c
5.Use Application.OnKey to register sub module with key stroke