View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Mike[_110_] Mike[_110_] is offline
external usenet poster
 
Posts: 3
Default Why doesn't OnKey work?

With a little bit more experimenting, it appears that it works if I'm typing
into a WorkSheet but I was hoping that it would work when a Userform had the
focus.

Hopefull thinking, huh!!

"Mike" wrote in message
...
I have the following two subs below. From the help files, it's my
understanding that after running sub "setit", I should be able to do a
"Control s" and then sub "doit" will be called. It doesn't work. I have
Excel 2003. Am I misunderstanding the usage of ONKEY or what am I doing
wrong??

Thanks for any help

Sub doit()
Dim aa
aa = aa
End Sub

Sub setit()
Application.OnKey "^s", "doit"
End Sub