View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Josh C Josh C is offline
external usenet poster
 
Posts: 55
Default disable shortcuts

Thanks for the idea, it looks like it should work. My only question is where
did you come up with the range of numbers for the loop. they look like odd
numbers, if i knew where you came up with them i would feel better.

Tahnks Again, Josh

"Vergel Adriano" wrote:

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