Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: mis-hitting F1 key for F2 key aggravation

Status
Not open for further replies.

TomBarsh

Structural
Jun 20, 2002
1,003
0
36
CA
An Excel tip: I use the F2 keyboard key all the time to activate cells for editing. For years I had been bothered by accidentally hitting the F1 key, this causes a long pause while waiting for the Help system to open instead.

In another forum I read about a guy so desperate that he removed the F1 function key cap (it's not fun when this happens a dozen or more times a day!). I took his advice and for the past couple years I have lived without the F1 key cap. I do need the F1 key on occasion (for Excel or other software) but it's a simple matter to stick a pen down in the key well to activate the F1 key.
 
I sometimes have trouble mis-hitting Q when I want to type A - should I remove the cap from the Q?

Would it be safer to remove all the keycaps and just stick a pen down the holes when I need to type?


[smile] Maybe I should just use a pen and paper if I can't be bothered to learn to use a keyboard! [smile]

(I assume that you intend this thread as a joke)

Good Luck
johnwm
________________________________________________________
To get the best from these forums read faq731-376 before posting
Steam Engine enthusiasts
Steam Engine Prints
 
A more elegant way to do this would be to use a macro in your your Personal.XLS file to disable the F1 key. Place the following macro in the ThisWorkbook section of the code of Personal.XLS. That way it only affects Excel. Of course, you can still access help through the menu.

Code:
Private Sub Workbook_Open()
Application.OnKey "{F1}", ""
End Sub
 
Could you not create a macro and let
F1 = F2 when you are in excel then either
would give you the result?
.
 
Actually, I was not kidding. And I did not mean that people should remove their 'Q' key either, I did not state that (did I? maybe I did, I am forgetful you know)

The "OnKey" command lends itself nicely to this problem. I can turn off the F1 key action. But my disabled left claw will probably still hit the F1 key more often than not when attempting to press F2. I'm sure there is a way to swap the behavior of the F1 and F2 keys.

But...I have a problem with the "OnKey" command. Since that is a new issue, I will begin new thread.
 
How about you just leave help open? That way if you hit F1 you only need to wait for the already open window to come to the top.

Seems far less invasive than any of the other options.
 
TomBarsh, I checked out your other thread, this one seems to be more fun.

With April 1st coming up I think I can configure all the keyboards in my office to act erratically.

Everyone here is using a customized add-in which I can add code to. I think I'll give myself a pat on the back every time someone uses the "a" key.

Code:
Private Sub Workbook_Open()
Application.OnKey "a", "Pat_on_the_back"
End Sub

Sub Pat_on_the_back()
MsgBox "Brad is a genius."
ActiveCell.Value = ActiveCell.Value + "a"
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnKey "a", ""
End Sub

Incidentally while I was testing this I first used SendKeys to add the "a" where it was typed and not surprisingly I got caught in an endless loop. I sprained my arm patting myself on the back so often.

Boy, I kill me.

Brad
 
Hi TomBarsh:

Along with Brad's contribution, you may find the following SUBs to be of interest ...
Code:
Sub ySF1F2()
    'Mar-10-2007 ... macro by Yogi Anand
    'call switchF1F2 to switch F1 key to F2 functionality
    Application.OnKey "{F1}", "switchF1F2"
End Sub

Sub switchF1F2()
    'Mar-10-2007 ... macro by Yogi Anand
    'switches F1 key to F2 functionality
    Application.SendKeys "{F2}", True
End Sub

Sub RestoreF1()
    'Mar-10-2007 ... macro by Yogi Anand
    'restores F1 key functionality
    Application.OnKey "{F1}"
End Sub


Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
ANAND Enterprises LLC
 
Status
Not open for further replies.
Back
Top