Link to home
Start Free TrialLog in
Avatar of washdcanalyst
washdcanalyst

asked on

Disabling F1 in Excel

How do I completely disable F1 in Excel (version 9 on W2000)
ASKER CERTIFIED SOLUTION
Avatar of WATYF
WATYF

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of byundt
Hi washdcanalyst,

Try a macro like the following:
Sub NoMoreF1()
Application.OnKey "{F1}", ""
End Sub

Cheers!

Brad
Avatar of WATYF
WATYF

FYI... If you want to make this feature available to all users on that PC (and not just to that particular file), then you can add the module to the Personal.xls file.


WATYF
Does this change for MS Excel 2002, because I can't get it to work.  Thanks in advance for your help.
girlygeek,
These two subs are working for me in Excel 2002. The first one turns F1 off--nothing happens. The second one turns it back on.

Sub NoMoreF1()
Application.OnKey "{F1}", ""
End Sub

Sub RestoreF1()
Application.OnKey "{F1}"
End Sub

You can test the subs as-is. To turn the F1 key off for Excel when it launches, you would want to incorporate the essence in a Workbook_Open sub of a workbook stored in your XLSTART directory. Because this workbook will open up every time Excel launches, it will turn off the F1 key for that session.

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

This sub needs to go in the ThisWorkbook code pane. The workbook in turn needs to be stored in the XLSTART directory. On my computer, this is found in C:\Documents and Settings\my name\Application data\Microsoft\Excel\XLSTART.

Brad