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 34 weeks ago
6 years 20 weeks ago
6 years 32 weeks ago
6 years 35 weeks ago
6 years 36 weeks ago
6 years 42 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago