ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable Ctrl- PAGEUP PAGEDWN (https://www.excelbanter.com/excel-programming/403831-disable-ctrl-pageup-pagedwn.html)

BOSS

Disable Ctrl- PAGEUP PAGEDWN
 
I wish to disable CTRL-pageup & pagedown so that the user cannot swith
between worsheets. I would even wish to hide the Tools-option-sheettabs, so
that user can only work in his worksheet.

Hope what i am lookingf for.. Thanks a lot for help.
Boss

Vergel Adriano

Disable Ctrl- PAGEUP PAGEDWN
 
Maybe try this in a code module:

Sub DummyProc()
Beep
End Sub

Sub DisableKeys()
Application.OnKey "^{PGUP}", "DummyProc"
Application.OnKey "^{PGDN}", "DummyProc"
End Sub

Sub RestoreKeys()
Application.OnKey "^{PGUP}"
Application.OnKey "^{PGDN}"
End Sub


To disable the ctrl+pgup and ctrl+pgdn call the DisableKeys sub. To get
them back, use the RestoreKeys sub.

--
Hope that helps.

Vergel Adriano


"Boss" wrote:

I wish to disable CTRL-pageup & pagedown so that the user cannot swith
between worsheets. I would even wish to hide the Tools-option-sheettabs, so
that user can only work in his worksheet.

Hope what i am lookingf for.. Thanks a lot for help.
Boss


BOSS

Disable Ctrl- PAGEUP PAGEDWN
 
Actually i have ten users and ten
respective sheets for them.

I have a login page which takes them to therir respective sheet. All i wish
is that one user can only access one sheet.

All the ten sheets are password protected with different passwords. Each
user is aware of his own password. The file is shared.

I have also blocked sheets tabs & freezed tools options using macro. Now i
want to disable Ctrl page up & Page down so that user cannot move to
different sheets.

Hope the situation is more clear. Thanks a lot for help in advance..

Boss


"Boss" wrote:

I wish to disable CTRL-pageup & pagedown so that the user cannot swith
between worsheets. I would even wish to hide the Tools-option-sheettabs, so
that user can only work in his worksheet.

Hope what i am lookingf for.. Thanks a lot for help.
Boss


BOSS

Disable Ctrl- PAGEUP PAGEDWN
 
Thanks a lot for ur help..
It really solved my purpose..

Many thanks
Boss


"Vergel Adriano" wrote:

Maybe try this in a code module:

Sub DummyProc()
Beep
End Sub

Sub DisableKeys()
Application.OnKey "^{PGUP}", "DummyProc"
Application.OnKey "^{PGDN}", "DummyProc"
End Sub

Sub RestoreKeys()
Application.OnKey "^{PGUP}"
Application.OnKey "^{PGDN}"
End Sub


To disable the ctrl+pgup and ctrl+pgdn call the DisableKeys sub. To get
them back, use the RestoreKeys sub.

--
Hope that helps.

Vergel Adriano


"Boss" wrote:

I wish to disable CTRL-pageup & pagedown so that the user cannot swith
between worsheets. I would even wish to hide the Tools-option-sheettabs, so
that user can only work in his worksheet.

Hope what i am lookingf for.. Thanks a lot for help.
Boss



All times are GMT +1. The time now is 09:10 PM.

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