Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Help with using OnKey

When included in the "ThisWorkbook" Module, this code does caused the named
procedures to run when the described keys are pressed. Furthermore, when a
subroutine in that module runs, this code causes an error message stating:
"Only comments may appear after an End Sub, End Function, or End Property".
Does that mean that this code needs to be included in a subroutine?

Application.OnKey "%{LEFT}", "ShiftLeft"
Application.OnKey "%{RIGHT}", "ShiftRight"

Thanks,

Keith


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Help with using OnKey

Yup. That code that you have there needs to be in a subroutine. As a guess in
thisworkbook you probably want to place it in the workbook open sub.
--
HTH...

Jim Thomlinson


"keithb" wrote:

When included in the "ThisWorkbook" Module, this code does caused the named
procedures to run when the described keys are pressed. Furthermore, when a
subroutine in that module runs, this code causes an error message stating:
"Only comments may appear after an End Sub, End Function, or End Property".
Does that mean that this code needs to be included in a subroutine?

Application.OnKey "%{LEFT}", "ShiftLeft"
Application.OnKey "%{RIGHT}", "ShiftRight"

Thanks,

Keith



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 Method cottage6 Excel Programming 1 October 20th 04 05:56 PM
code help - onkey bforster1[_8_] Excel Programming 3 July 25th 04 05:45 PM
onkey help wardy Excel Programming 0 July 20th 04 05:49 PM
onkey peter Excel Programming 2 March 2nd 04 07:34 PM
Onkey Jase Excel Programming 1 November 17th 03 11:07 PM


All times are GMT +1. The time now is 02:35 PM.

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"