VBA to disable keystrokes?

M

Mark

I have customised a file which removes toolbars, menus etc and some of the
sheets (accessed by macros linked to buttons) I want to keep private.

However, I have realised that the sheets can be accessed by using ctrl+page
up or page down. Is there a macro I can use to disable these keys?

Another way would be to hide the sheets I don't want people to access but I
cant unhide them and rehide them using a macro for some reason
(worksheets.visible) when I need to access them.

Any help would be appreciated.

Mark
 
N

Norman Jones

Hi Mark,
Another way would be to hide the sheets I don't want people to access but
I
cant unhide them and rehide them using a macro for some reason
(worksheets.visible) when I need to access them.

This should be feasible.

Post the problematic code.
 
A

Ardus Petus

To disable/reenable Ctrl+PGUP & PGDN:

'--------------------------------
Sub NoTab()
With Application
.OnKey "^{PGUP}", ""
.OnKey "^{PGDN}", ""
End With
End Sub

Sub ResetTab()
With Application
.OnKey "^{PGUP}"
.OnKey "^{PGDN}"
End With
End Sub
'--------------------------------

HTH
 
Top