+ Reply to Thread
Results 1 to 2 of 2

Hot Key

  1. #1
    Registered User
    Join Date
    06-14-2005
    Posts
    1

    Hot Key

    Hey
    Does anyone know how I can assign a macro be performed when F9 is clicked ?

  2. #2
    Earl Kiosterud
    Guest

    Re: Hot Key

    Busgy,

    Use the OnKey method. Run this once (perhaps put it in the Workbook_Open
    handler or something):

    Application.OnKey "{F9}", "MySub"

    Now when F9 is pressed, it'll run MySub. Note that this is for any open
    workbooks, not just the one that ran the macro. Also, it will remain in
    effect when you close the workbook, and if F9 is pressed then, it'll reopen
    the workbook containing MySub. You can reset the F9 key with:

    Application.OnKey "{F9}", ""

    which works nicely in the Workbook_BeforeClose event handler.
    --
    Earl Kiosterud
    mvpearl omitthisword at verizon period net
    -------------------------------------------

    "Bugsy" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hey
    > Does anyone know how I can assign a macro be performed when F9 is
    > clicked ?
    >
    >
    > --
    > Bugsy
    > ------------------------------------------------------------------------
    > Bugsy's Profile:
    > http://www.excelforum.com/member.php...o&userid=24300
    > View this thread: http://www.excelforum.com/showthread...hreadid=379060
    >




+ 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