Apply a Macro to a FunctionKey... (again, but with correct email address)

D

doo

Hi

My problem is I would like to run a macro called "five" when I hit the F5
key... (just the key, without Ctrl or Alt key). Excel
Does someone would own the code I'm looking for ?

Thank you VERY much for your help, I look for a while on the web but don't
find anything.

Frenchie,
 
D

doo

Hello

Thank you for your info, but my problem is that I don't understand at all
VBA ... ;-(
(where do I write it ? wich syntax ? what is a proc ? etc...)

But however thanks a lot for the info, for sure it is what I'm looking for !

Thanxxxs
Frenchie
 
R

Ron de Bruin

Hi doo

You can put a macro like this in a module in the workbook and assign it to a shortcut
(F5 in this example)

Sub test()
MsgBox "Hi"
End Sub

This in a the Thisworkbook module

Private Sub Workbook_Activate()
Application.OnKey "{F5}", "test"
End Sub

Private Sub Workbook_Deactivate()
Application.OnKey "{F5}"
End Sub
 
Top