Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using function keys in macros
Is there a way to let the function keys control a macro? For example, I want to write a program that will run a macro whenever you press F1. How would I do that? -- Tha BeatMaker ------------------------------------------------------------------------ Tha BeatMaker's Profile: http://www.excelforum.com/member.php...o&userid=23998 View this thread: http://www.excelforum.com/showthread...hreadid=397040 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using function keys in macros
See the OnKey method in help. E.g., to assign a macro to F1, use
Application.OnKey "{F1}", "MacroName" -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Tha BeatMaker" wrote in message news:Tha.BeatMaker.1tzfuc_1124406334.2583@excelfor um-nospam.com... Is there a way to let the function keys control a macro? For example, I want to write a program that will run a macro whenever you press F1. How would I do that? -- Tha BeatMaker ------------------------------------------------------------------------ Tha BeatMaker's Profile: http://www.excelforum.com/member.php...o&userid=23998 View this thread: http://www.excelforum.com/showthread...hreadid=397040 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using function keys in macros
I have created a userform, label and macro named UserForm1, lblPress and Functest respectively. Here is my code. Private Sub UserForm_Initialize() Application.OnKey "{F10}", "functest" End Sub ---------------------------------------------------------------------- Private Sub UserForm_Terminate() Application.OnKey "{F10}" End Sub ---------------------------------------------------------------------- Sub functest() Const conMsg As String = "You have pressed F10" lblPress.Caption = conMsg End Su -- Tha BeatMake ----------------------------------------------------------------------- Tha BeatMaker's Profile: http://www.excelforum.com/member.php...fo&userid=2399 View this thread: http://www.excelforum.com/showthread.php?threadid=39704 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macros will not run with shortcut keys | Excel Worksheet Functions | |||
macros shortcut keys don't work | New Users to Excel | |||
Time keys in macros | Excel Discussion (Misc queries) | |||
Macros Shortcut keys | Setting up and Configuration of Excel | |||
listing macros associated with shortcut keys | Excel Programming |