Pages

Friday, May 29, 2009

Disable F1 key in Excel Sheet

Yesterday, I was working on excel sheet and I was so frustrated with the function key F1 Key. Generally I use F2 key to edit the contents of the Cell. F1 & F2 are so close together, so accidentally I pressed F1 instead of F2 to edit the cell. All most half of my time went off closing the help window. It is really frustrating.

As you know F1 is the key that would help you, if you are running into problems or need something. But in this case I am running into problems because of F1, Now who is going to help me??

So I decided, either I should remove the F1 key from keyboard or write a program to disable the F1 key. I am a programmer so I thought I should write a program to save my life.

I hope the below code would be useful to you guys. In just five minutes you can disable your F1 key.

1. Open Excel sheet
2. Can you see below icons in your excel tool bar? If not then right click on the tool bar and select Visual Basic 3. Click on Visual Basic Editor Icon
4. Under the Microsoft Excel Objects, double click on ThisWorkbook.
5. Add the below code
Private Sub Workbook_Open()
Application.OnKey "{F1}", ""
End Sub

6. Save the excel sheet and save your life. That’s it.

2 comments:

Jim said...

Man I hate that help window! I can't believe I didn't think to disable this thing sooner. This is a life-saver. I feel a whole new world opening before me!

Anonymous said...

Thanks vijaya. But what if i want it to make applicable for all excel workbooks?
thanks
sreenivas