Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Onkey doesn't work

Hi All,

I'm trying to use Onkey method for the first time, but it fails, even if I
try the example in XL2003 Help:
Application.OnKey "^{+}", "InsertProc"

Nothing happens when I press CTRL+{+} button.
I checked EnableEvents, it was set true.

What can be the problem?

Thanks,
Stefi

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Onkey doesn't work

Hi Stefi,

Nothing happens when I press CTRL+{+} button.
I checked EnableEvents, it was set true.

What can be the problem?


ON my keyboard, the plus appears above the equal sign, so I need to
hold the shift key too to make it happen.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Onkey doesn't work

Hi Jan,

Yes, if I press the CTRL+SHIFT+Plus sign(in the upper row of the keyboard)
it works. I tried CTRL+Plus sign(on the numeric keypad), I didn't know that
Onkey doesn't affect the numeric keys. Or does it? If so, how?

Regards,
Stefi


€˛Jan Karel Pieterse€¯ ezt Ć*rta:

Hi Stefi,

Nothing happens when I press CTRL+{+} button.
I checked EnableEvents, it was set true.

What can be the problem?


ON my keyboard, the plus appears above the equal sign, so I need to
hold the shift key too to make it happen.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Onkey doesn't work

Hi Stefi,

I didn't know that
Onkey doesn't affect the numeric keys. Or does it? If so, how?


Me neither and unfortunately, I cannot test this right now either
(laptop without num pad).

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Onkey doesn't work

By the way Jan, is it possible to pass a parameter to a sub triggered by
Onkey, something like this:

Application.OnKey "^{+}", "InsertProc(parameter)"

Stefi


€˛Jan Karel Pieterse€¯ ezt Ć*rta:

Hi Stefi,

Nothing happens when I press CTRL+{+} button.
I checked EnableEvents, it was set true.

What can be the problem?


ON my keyboard, the plus appears above the equal sign, so I need to
hold the shift key too to make it happen.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Onkey doesn't work

Hi Stefi,

By the way Jan, is it possible to pass a parameter to a sub triggered by
Onkey, something like this:

Application.OnKey "^{+}", "InsertProc(parameter)"


Not that I know of. But you can declare a variable at the top of the module
and use that inside the called routine. That variable will retain its value
for the duration of the project and can be altered (and read) by other subs
in the same module.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Onkey doesn't work


Jan Karel Pieterse Wrote:
Hi Stefi,

I didn't know that
Onkey doesn't affect the numeric keys. Or does it? If so, how?


Me neither and unfortunately, I cannot test this right now either
(laptop without num pad).

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com


Absolutely no idea if it works, and no time to check before thi
evening, but isnt there something like vbKeyNumpadPlus?
I think it works for numbers, if it does, shouldnt be too hard t
figure out for plus key.

Try something like

-Application.OnKey "{" & vbKeyNumpad1 & "}", "MyMacro"-

As I said, I'm wandering the net lately about excel vb code, and I kno
I've seen that - but no idea if it works

--
lonfnic
-----------------------------------------------------------------------
lonfnico's Profile: http://www.excelforum.com/member.php...fo&userid=3339
View this thread: http://www.excelforum.com/showthread.php?threadid=53257

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Onkey doesn't work

Hi Jan,

Please let me know if you find an answer!

Regards,
Stefi


€˛Jan Karel Pieterse€¯ ezt Ć*rta:

Hi Stefi,

I didn't know that
Onkey doesn't affect the numeric keys. Or does it? If so, how?


Me neither and unfortunately, I cannot test this right now either
(laptop without num pad).

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OnKey Hernan Excel Programming 2 January 11th 06 04:18 PM
Help with using OnKey keithb Excel Programming 1 December 19th 05 11:03 PM
onkey help wardy Excel Programming 0 July 20th 04 05:49 PM
application.onkey doesn't work bob Excel Programming 2 May 10th 04 11:06 AM
onkey peter Excel Programming 2 March 2nd 04 07:34 PM


All times are GMT +1. The time now is 11:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"