+ Reply to Thread
Results 1 to 2 of 2

Help with using OnKey

  1. #1
    keithb
    Guest

    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. #2
    Jim Thomlinson
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1