View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tha BeatMaker[_11_] Tha BeatMaker[_11_] is offline
external usenet poster
 
Posts: 1
Default 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