binding a number key to a macro
Basically, i want to be able to hit 1 and have a macro run. I found this code, though i dont know how to bind it to a macro.
So if i make a simple macro like;
Sub Adding()
'
' Adding Macro
'
'
ActiveCell.FormulaR1C1 = "=RC[-3]+RC[-2]"
Range("D2").Select
End Sub
Then make a new module, and put in;
Sub test()
MsgBox "Hello"
End Sub
Sub Shortcut1()
Application.OnKey "1", "test"
End Sub
How do i bind the macro to this hotkey? Or rather, how do i make the macro run when i hit the 1 key?
Recent comments
5 years 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago