ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Shortcut Keys (https://www.excelbanter.com/excel-programming/294764-shortcut-keys.html)

John Whelan

Shortcut Keys
 
How do I disable Shortcut Keys ?

Chip Pearson

Shortcut Keys
 
John,

You really can't disable all of Excel's shortcut keys.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"John Whelan" wrote in
message ...
How do I disable Shortcut Keys ?




Jim Rech

Shortcut Keys
 
By assigning the shortcut a null macro:

Sub KillCtrlA()
Application.OnKey "^a", ""
End Sub

to reset:

Sub AllowCtrlA()
Application.OnKey "^a"
End Sub

--
Jim Rech
Excel MVP
"John Whelan" wrote in message
...
How do I disable Shortcut Keys ?




Tom Ogilvy

Shortcut Keys
 
see excel vba help on onkey

--
Regards,
Tom Ogilvy


"John Whelan" wrote in message
...
How do I disable Shortcut Keys ?




Ron de Bruin

Shortcut Keys
 
You really can't disable all of Excel's shortcut keys.

Maybe this <g

Sub Disable()
Dim K, Key, Key2, I As Integer
On Error Resume Next

For Each Key In Array("+", "^", "%", "+^", "+%", "^%", "+^%")

K = Array("{BS}", "{BREAK}", "{CAPSLOCK}", "{CLEAR}", "{DEL}", _
"{DOWN}", "{END}", "{ENTER}", "~", "{ESC}", "{HELP}", "{HOME}", _
"{INSERT}", "{LEFT}", "{NUMLOCK}", "{PGDN}", "{PGUP}", _
"{RETURN}", "{RIGHT}", "{SCROLLLOCK}", "{TAB}", "{UP}")

For Each Key2 In K
Application.OnKey Key & Key2, ""
Next Key2

For I = 0 To 255
Application.OnKey Key & Chr$(I), ""
Next I

For I = 1 To 15
Application.OnKey Key & "{F" & I & "}", ""
Application.OnKey "{F" & I & "}", ""
Next I
Next
End Sub


Sub Enable()
Dim K, Key, Key2, I As Integer
On Error Resume Next

For Each Key In Array("+", "^", "%", "+^", "+%", "^%", "+^%")

K = Array("{BS}", "{BREAK}", "{CAPSLOCK}", "{CLEAR}", "{DEL}", _
"{DOWN}", "{END}", "{ENTER}", "~", "{ESC}", "{HELP}", "{HOME}", _
"{INSERT}", "{LEFT}", "{NUMLOCK}", "{PGDN}", "{PGUP}", _
"{RETURN}", "{RIGHT}", "{SCROLLLOCK}", "{TAB}", "{UP}")

For Each Key2 In K
Application.OnKey Key & Key2
Next Key2

For I = 0 To 255
Application.OnKey Key & Chr$(I)
Next I

For I = 1 To 15
Application.OnKey Key & "{F" & I & "}"
Application.OnKey "{F" & I & "}"
Next I
Next
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Chip Pearson" wrote in message ...
John,

You really can't disable all of Excel's shortcut keys.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"John Whelan" wrote in
message ...
How do I disable Shortcut Keys ?







All times are GMT +1. The time now is 01:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com