Disable hotkeys

  • Thread starter Thread starter Guest
  • Start date Start date
You could use a small macro.

For example, this disables the F1 (help) key:

Option Explicit
Sub disableF1()
Application.OnKey "{f1}", ""
End Sub

And this would toggle it back to normal.

Sub enableF1()
Application.OnKey "{f1}"
End Sub

If you look at sendkeys in VBA's help, you'll see how to override special keys.
(Like ctrl-c for copy.)
 
Thanks a lot.

Dave Peterson said:
You could use a small macro.

For example, this disables the F1 (help) key:

Option Explicit
Sub disableF1()
Application.OnKey "{f1}", ""
End Sub

And this would toggle it back to normal.

Sub enableF1()
Application.OnKey "{f1}"
End Sub

If you look at sendkeys in VBA's help, you'll see how to override special keys.
(Like ctrl-c for copy.)
 
Back
Top