View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Apply a Macro to a FunctionKey... (again, but with correct email address)

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



--
Regards Ron de Bruin
http://www.rondebruin.nl


"doo" wrote in message ...
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
doo



"Ron de Bruin" a écrit dans le message de
...
Hi Doo

Look in the VBA help for Application.Onkey


--
Regards Ron de Bruin
http://www.rondebruin.nl


"doo" wrote in message

...
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,
doo