Results 1 to 9 of 9
  1. #1
    Lounger
    Join Date
    Sep 2003
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    reassign keys (excel2002)

    I sthere a way to reassign keys to the function keys within excel. I would like to make the alt + u shortcut macro key to be reassigned to the f1 key. Thanks

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: reassign keys (excel2002)

    No. The options available are: using the Ctrl + choices in the Run Macro dialog (Alt+F8), assigning the macro to a toolbar, and setting a hotkey ("&") prefix to the text name. The latter enables symbol keys - but not the Function Keys. (Make sure the toolbar display is not "icon only".) HTH
    Gre

  3. #3
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: reassign keys (excel2002)

    You could create a macro, assign ctrl-u as the shortcut. the macro would only need to call help:

    <pre>application.help</pre>


    If you want the F1 key to do something different you can use onkey to reassign it to your own macro:

    <pre>Application.OnKey "{F1}", "MyF1Procedure"</pre>


    Steve

  4. #4
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: reassign keys (excel2002)

    <img src=/S/drop.gif border=0 alt=drop width=23 height=23> Memory like a <img src=/S/blackhole.gif border=0 alt=blackhole width=15 height=15>!
    Gre

  5. #5
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: reassign keys (excel2002)

    As another posted told you, you can use the OnKeys() method but make sure you reset the assignment otherwise when users open a different workbook and hit F1 expecting the normal Help system to pop up, they'll get an error. Add this code to your ThisWorkbook:
    <pre>Private Sub Workbook_Deactivate()
    Application.OnKey "{F1}", ""
    End Sub

    Private Sub Workbook_Activate()
    Application.OnKey "{F1}", "MySpecialCode"
    End Sub

    Private Sub Workbook_Open()
    Application.OnKey "{F1}", "MySpecialCode"
    End Sub</pre>


    Where "MySpecialCode" is the name of the routine you want to run when F1 is pressed.

    The help is quite useful for the OnKey method so give it a perusal.

    Deb

  6. #6
    Lounger
    Join Date
    Sep 2003
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: reassign keys (excel2002)

    Thanks to all

  7. #7
    Lounger
    Join Date
    Sep 2003
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: reassign keys (excel2002)

    Do i put thus routine as a seperate macro with the auto_open name to iniate this at open of worksheet? Thanks

  8. #8
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: reassign keys (excel2002)

    Put it in your personal.xls as an auto_open or under the ThisWorkbook Workbook_Open() event.
    -John ... I float in liquid gardens
    UTC -7DS

  9. #9
    Lounger
    Join Date
    Sep 2003
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: reassign keys (excel2002)

    Thanks. I thought I might have been the only one working this late LOL

Posting Permissions

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