Thread: Access Key
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Greg B[_15_] Greg B[_15_] is offline
external usenet poster
 
Posts: 7
Default Access Key

Same problem I cant trigger it from the userform. I start the program and
it loads the MAIN userform. It is on this userform I want to have the
ability to use short cut keys.

Sorry I wasnt clear.

Greg

"Office_Novice" wrote in message
...
Put This in The 'ThisWorkbook Module:

Sub SetupF2()
Application.OnKey "^{F2}", "OpenForm" 'I added the Ctrl key so Ctrl +F2
End Sub

in a standard module put:

Function OpenForm()
UserForm1.Show
End Function

HTH

"Greg B" <browgregory"nospam" wrote:

I asked last week about access keys and I need to ask a bit more.

Sub SetupF2()
Application.OnKey "{F2}", "OpenForm"
End Sub

Sub OpenForm()
UserForm1.Show
End Sub


This was the code I was given but it does not seem to work with userform.
I
placed the code in the userform activate macro, and when I press f2 it
does
not do a thing.

Is it possible to use the function keys from a userform?

Thanks
Greg