Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Redefining the Ctrl [ and Ctrl ]s short cut with OnKey?

I would like to assign subroutines to two key sequences, default Excel
shortcut key sequences: Ctrl [ and Ctrl ].

Is this possible?

I placed this code in the "ThisWorkbook" module of PERSONAL.xls and got this
error: "Method 'OnKey' object '_Application' failed.

-------
Option Explicit
Private Sub Workbook_Open()
Application.OnKey "^[", "FindLinkedCell"
Application.OnKey "^[", "ReturnToCell"
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnKey "^["
Application.OnKey "^]"
End Sub
---------

The the procedures execute and the keys are rediefined if I use Ctrl a
("^a") and Ctrl b.
John Wirt


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Redefining the Ctrl [ and Ctrl ]s short cut with OnKey?

Hi John

Use this
Application.OnKey "^{[}", "FindLinkedCell"



--
Regards Ron de Bruin
http://www.rondebruin.nl



"John Wirt" wrote in message ...
I would like to assign subroutines to two key sequences, default Excel
shortcut key sequences: Ctrl [ and Ctrl ].

Is this possible?

I placed this code in the "ThisWorkbook" module of PERSONAL.xls and got this
error: "Method 'OnKey' object '_Application' failed.

-------
Option Explicit
Private Sub Workbook_Open()
Application.OnKey "^[", "FindLinkedCell"
Application.OnKey "^[", "ReturnToCell"
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnKey "^["
Application.OnKey "^]"
End Sub
---------

The the procedures execute and the keys are rediefined if I use Ctrl a
("^a") and Ctrl b.
John Wirt




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Redefining the Ctrl [ and Ctrl ]s short cut with OnKey?

Ron, Thank you. John



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Redefining the Ctrl [ and Ctrl ]s short cut with OnKey?

Unfortunately, this solution does not work (at least for me).

John

"Ron de Bruin" wrote in message
...
Hi John

Use this
Application.OnKey "^{[}", "FindLinkedCell"



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Redefining the Ctrl [ and Ctrl ]s short cut with OnKey?

Hi John

Do you see an error?

--
Regards Ron de Bruin
http://www.rondebruin.nl



"John Wirt" wrote in message ...
Unfortunately, this solution does not work (at least for me).

John

"Ron de Bruin" wrote in message
...
Hi John

Use this
Application.OnKey "^{[}", "FindLinkedCell"







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Redefining the Ctrl [ and Ctrl ]s short cut with OnKey?

Yes, the error is: Method 'OnKey' of object '_Application' failed.


The code is (copied):

Private Sub Workbook_Open()
Application.OnKey "^([)", "FindLinkedCell"
Application.OnKey "^(])", "ReturnToCell"
End Sub

John
----------------------------
"Ron de Bruin" wrote in message
...
Hi John

Do you see an error?

--
Regards Ron de Bruin
http://www.rondebruin.nl





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Redefining the Ctrl [ and Ctrl ]s short cut with OnKey?

Use a { and not a (



--
Regards Ron de Bruin
http://www.rondebruin.nl



"John Wirt" wrote in message ...
Yes, the error is: Method 'OnKey' of object '_Application' failed.


The code is (copied):

Private Sub Workbook_Open()
Application.OnKey "^([)", "FindLinkedCell"
Application.OnKey "^(])", "ReturnToCell"
End Sub

John
----------------------------
"Ron de Bruin" wrote in message
...
Hi John

Do you see an error?

--
Regards Ron de Bruin
http://www.rondebruin.nl







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
Is there a difference between CTRL+D and CTRL+" (quotation marks) AKMMS Excel Discussion (Misc queries) 2 March 22nd 10 07:43 PM
How to make Ctrl-C, ctrl-V work in Office 2007 hj Excel Discussion (Misc queries) 1 June 23rd 09 01:09 PM
Excel 2007: Ctrl+PgUp or Ctrl+PgDn with Protected Sheets DrDave Excel Discussion (Misc queries) 1 July 28th 08 04:12 AM
cut & paste with short cut keys (ctrl C V) with absolute cell refe Modeller Dave Excel Discussion (Misc queries) 1 December 7th 04 11:14 PM
Disabling Ctrl-PgUp and Ctrl-PgDn K.A. Hueston Excel Programming 3 October 9th 04 12:31 AM


All times are GMT +1. The time now is 06:54 PM.

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

About Us

"It's about Microsoft Excel"