Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Location
    Slovenia
    Posts
    56

    Unanswered: F4 to run a macro

    Is it possible to press F4 to run a macro?

    Or How can I assign a code on certain key?
    Back to the basics...

  2. #2
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    Hi

    All you need to do is setup the key probably on the Workbook_Open Event

    there you could put the code

    Application.OnKey {F4} , "MyMacroName"

    this sets up when you press the F4 key it will run the Subroutine MyMacroName

    in the Workbook_BeforeClose event use the code

    Appliacation.OnKey {F4}

    this stops the macro running everytime you press F4 if the Workbook isn't open

    HTH

    David

  3. #3
    Join Date
    Mar 2004
    Location
    Slovenia
    Posts
    56

    F4

    I tried it and it works perfectly!

    thx
    Back to the basics...

Posting Permissions

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