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 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago