View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano Vergel Adriano is offline
external usenet poster
 
Posts: 857
Default disable shortcuts

Josh,

to programatically disable CTRL+C, you can do this:

Application.OnKey "^c", ""

to re-enable, you use

Application.OnKey "^c"

So, to disable/enable CTRL+KEY and CTRL+SHIFT+KEY shortcuts, you can do
something like this:


Sub DisableShortCuts()
Dim iChar As Integer

'disable CTRL+KEY shortcuts
For iChar = 97 To 122 'a to z
Application.OnKey "^" & Chr(iChar), ""
Next iChar

'disable CTRL+SHIFT+KEY shortcuts
For iChar = 65 To 90 'A to Z
Application.OnKey "^" & Chr(iChar), ""
Next iChar

End Sub


Sub EnableShortCuts()
Dim iChar As Integer

're-enable CTRL+KEY shortcuts
For iChar = 97 To 122 'a to z
Application.OnKey "^" & Chr(iChar)
Next iChar

're-enable CTRL+SHIFT+KEY shortcuts
For iChar = 65 To 90 'A to Z
Application.OnKey "^" & Chr(iChar)
Next iChar

End Sub


--
Hope that helps.

Vergel Adriano


"Josh C" wrote:

i was hoping for a way to stop all the shortcuts without doing them
individually, do you know if it is possible

"Gary''s Student" wrote:

The usual short-cut for Copy is CNTRL-C.


To disable this, create a "do nothing" macro and assign CNTRL-C to it.
--
Gary''s Student - gsnu200718


"Josh C" wrote:

I could be looking in the wrong spot, but is there a easy way to disable the
shotcut options on MS Excel