Ctrl+PgUp and Ctrl+PgDn

K

Keith Hueston

I have a workbook in Excel 97 with two windows. One is
PipeBook.xls:1 and the other is PipeBook.xls:2. I would
like to disable the function of Ctrl+PgUp and Ctrl+PgDn in
the window PipeBook.xls:2, however leave the function
available for window PipeBook.xls:1. Is that possible?
 
D

Don Guillett

take a look at SCROLLAREA in vba help.Put your code in the ThisWorkbook
module in the Open_Workbook macro.
 
O

Orlando Magalhães Filho

Hi Keith Hueston,

Try this:
- Open your Workbook;
- Press Alt+F11 to open VBE window;
- Double click on ThisWorkbook object;
- Insert the code below:

Private Sub Workbook_WindowActivate(ByVal Wn As Window)
If Wn.Caption = "PipeBook.xls:2" Then
Application.OnKey "^{PGUP}", ""
Application.OnKey "^{PGDN}", ""
Else
Application.OnKey "^{PGUP}"
Application.OnKey "^{PGDN}"
End If
End Sub

Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
Application.OnKey "^{PGUP}"
Application.OnKey "^{PGDN}"
End Sub


HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top