How to Disable F1 Key in Excel

When pressing F1 key it forth to enable Help pane in excel. In some situations, we can press F1 to enable other actions from other applications, for example, for some tools we can via pressing F1 to capture screen directly. So, we can disable F1 key in some instances. This article will help you to know the method to disable F1 key in excel by VBA code.

Method: Disable F1 Key in Excel


Click Help tab in ribbon, and move cursor floating on Help icon. You can see a tip pops up to indicate that F1 is the shortcut key for Microsoft Excel Help. Now let’s disable F1 key refer to below steps.

How to Disable F1 Key in Excel 1

Step 1: On current visible worksheet, right click on sheet name tab to load Sheet management menu. Select View Code, Microsoft Visual Basic for Applications window pops up.

Or you can enter Microsoft Visual Basic for Applications window via Developer->Visual Basic. You can also press Alt + F11 keys simultaneously to open it.

Step 2: In Microsoft Visual Basic for Applications window, click Insert->Module, enter below code in Module1:

Sub disableF1()

Application.OnKey "{F1}", ""

End Sub

Step 3: Save VBA code. And then quit Microsoft Visual Basic for Applications.

Step 4: Try to click F1, verify that Help system is not loaded and displayed.

Comment:

  1. This method only takes into effective on Excel 2007/2010, it doesn’t work on upper versions.
  2. If you want to enable F1 again, enter below VBA code:
Sub enableF1()

Application.OnKey "{F1}"

End Sub

 

Related Posts

Find and Replace Multiple Values

This post will guide you how to find and replace multiple values at once with VBA macro or using formula  in Excel. How do I make multiple find and replace in Excel. Suppose that you have a few cells containing ...

VBA Macro For VLOOKUP From Another Sheet

In the previous post, you should know that how to fix or remove the #N/A error when using VLOOKUP formula to lookup value from another sheet. And this post will show you how to use VBA code to vlookup data ...

How To Remove Special Characters in Excel

This post will show you how to remove special characters from text strings in Excel. And I am going to introduce two ways to remove special characters (@&)#%$) from a string in Excel. Removing Special Characters using Power Query If ...

How To Insert Comments in Protected Worksheet in Excel

This post will show you how to allow comments in a protected worksheet in Excel. You can easily to insert comments into cells in a normal worksheet in Excel, but if want to insert a comment in a worksheet that ...

How To Convert Text to Upper Cases(Using VBA) in Excel

This post will show you how to switch from lower case to upper case in Excel. and I am going to show you two different ways of converting text to upper cases using formula or VBA macro in Excel 2013,Excel ...

Sidebar