PC Review


Reply
Thread Tools Rate Thread

Application.Onkey

 
 
John
Guest
Posts: n/a
 
      17th Dec 2009
Hi,

Is there a way i can shorten:

With Application

.OnKey "{DOWN}"
.OnKey "{BS}"
.OnKey "{END}"
.OnKey "{HOME}"
.OnKey "{UP}"
.OnKey "{TAB}"
.OnKey "{PGDN}"
.OnKey "{PGUP}"
.OnKey "{RIGHT}"
.OnKey "{LEFT}"
.OnKey "{DELETE}"
.OnKey "{ESC}"
.OnKey "^{DEL}"
.OnKey "^{INSERT}"
.OnKey "^{F1}"
.OnKey "^{F2}"
.OnKey "^{F3}"
.OnKey "^{F4}"
.OnKey "^{F5}"
.OnKey "^{F6}"
.OnKey "^{F7}"
.OnKey "^{F8}"
.OnKey "^{F9}"
.OnKey "^{F10}"
.OnKey "^{F11}"
.OnKey "^{F12}"

End With

I've tried to use a reference to each of the keystrokes {DOWN} {BS} etc in a
sheet array Tbl_Keys and reference this in VB using:

Mykey = " ""{" & Application.WorksheetFunction.Index(Rng, I, 1) & "}, """
Application.OnKey Mykey

but i when i try to run it i get the message "Method 'Onkey of
Object_Application' failed.

Any ideas would be great.
Thanks
John


 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      17th Dec 2009
What are you trying to do and why

Regards,
Peter T

"John" <(E-Mail Removed)> wrote in message
news:7E042928-D2DE-4AB7-94D7-(E-Mail Removed)...
> Hi,
>
> Is there a way i can shorten:
>
> With Application
>
> .OnKey "{DOWN}"
> .OnKey "{BS}"
> .OnKey "{END}"
> .OnKey "{HOME}"
> .OnKey "{UP}"
> .OnKey "{TAB}"
> .OnKey "{PGDN}"
> .OnKey "{PGUP}"
> .OnKey "{RIGHT}"
> .OnKey "{LEFT}"
> .OnKey "{DELETE}"
> .OnKey "{ESC}"
> .OnKey "^{DEL}"
> .OnKey "^{INSERT}"
> .OnKey "^{F1}"
> .OnKey "^{F2}"
> .OnKey "^{F3}"
> .OnKey "^{F4}"
> .OnKey "^{F5}"
> .OnKey "^{F6}"
> .OnKey "^{F7}"
> .OnKey "^{F8}"
> .OnKey "^{F9}"
> .OnKey "^{F10}"
> .OnKey "^{F11}"
> .OnKey "^{F12}"
>
> End With
>
> I've tried to use a reference to each of the keystrokes {DOWN} {BS} etc in
> a
> sheet array Tbl_Keys and reference this in VB using:
>
> Mykey = " ""{" & Application.WorksheetFunction.Index(Rng, I, 1) & "}, """
> Application.OnKey Mykey
>
> but i when i try to run it i get the message "Method 'Onkey of
> Object_Application' failed.
>
> Any ideas would be great.
> Thanks
> John
>
>



 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      17th Dec 2009
Maybe
http://www.rondebruin.nl/key.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"John" <(E-Mail Removed)> wrote in message news:7E042928-D2DE-4AB7-94D7-(E-Mail Removed)...
> Hi,
>
> Is there a way i can shorten:
>
> With Application
>
> .OnKey "{DOWN}"
> .OnKey "{BS}"
> .OnKey "{END}"
> .OnKey "{HOME}"
> .OnKey "{UP}"
> .OnKey "{TAB}"
> .OnKey "{PGDN}"
> .OnKey "{PGUP}"
> .OnKey "{RIGHT}"
> .OnKey "{LEFT}"
> .OnKey "{DELETE}"
> .OnKey "{ESC}"
> .OnKey "^{DEL}"
> .OnKey "^{INSERT}"
> .OnKey "^{F1}"
> .OnKey "^{F2}"
> .OnKey "^{F3}"
> .OnKey "^{F4}"
> .OnKey "^{F5}"
> .OnKey "^{F6}"
> .OnKey "^{F7}"
> .OnKey "^{F8}"
> .OnKey "^{F9}"
> .OnKey "^{F10}"
> .OnKey "^{F11}"
> .OnKey "^{F12}"
>
> End With
>
> I've tried to use a reference to each of the keystrokes {DOWN} {BS} etc in a
> sheet array Tbl_Keys and reference this in VB using:
>
> Mykey = " ""{" & Application.WorksheetFunction.Index(Rng, I, 1) & "}, """
> Application.OnKey Mykey
>
> but i when i try to run it i get the message "Method 'Onkey of
> Object_Application' failed.
>
> Any ideas would be great.
> Thanks
> John
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.OnKey iamnu Microsoft Excel Discussion 1 26th Mar 2009 01:58 PM
A negative to using Application.Onkey =?Utf-8?B?QW5keWJybw==?= Microsoft Excel Programming 6 1st Nov 2007 03:38 PM
Application.onKey non-functioning =?Utf-8?B?TWFkaGFu?= Microsoft Excel Programming 4 21st Dec 2006 04:39 PM
How to apply Application.OnKey dewanna Microsoft Excel Programming 1 7th Apr 2006 07:16 AM
Application.OnKey Kevin H. Stecyk Microsoft Excel Programming 1 27th Jan 2005 01:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:05 PM.