[RESOLVED] Disable worksheet scrolling
Hello All..
It's been a while (bet you thought you got rid of me?)... I have just realized that Ctrl-PgUp and Ctrl-PgDown scrolls through the worksheets of an Excel project. I would like to disable this feature, possibly in my Workbook open code? Does anyone know how I would do this?
Thanks in advance......
Re: Disable worksheet scrolling
you could try using application.onkey to set those keys to do nothing
Re: Disable worksheet scrolling
With or without code? Cause it is possible both ways...
Re: Disable worksheet scrolling
Hello Koolsid,
I'm not sure how to answer that...What I want is to enter a code in the "Workbook_Open()" of "This Workbook" so, I guess I want it with a code?
Hope that makes sense......
Re: Disable worksheet scrolling
Hello WestConn1,
I would try that but I'm afraid of disabling those keys as I need the page up-and down for other applications in this project...
Re: Disable worksheet scrolling
you can specify if only with ctrl
or pass the key actions with other workbooks
Re: Disable worksheet scrolling
Quote:
Originally Posted by
NPD071
Hello Koolsid,
I'm not sure how to answer that...What I want is to enter a code in the "Workbook_Open()" of "This Workbook" so, I guess I want it with a code?
Hope that makes sense......
Yes it does :)
I'll share a little trick with you :)
On my screen I can see 43 row approx. If you want to see only 25 rows then change 43 to 25. After you run the code, you will see that Page down doesn't work....
Logic: I use "freeze pane" and then hide rest of the rows so that page down doesn't have any effect....
vb Code:
Private Sub Workbook_Open()
'~~> Change Row 43 to the row that you want
Rows("43:43").Select
'~~> Freeze Pane
ActiveWindow.FreezePanes = True
'~~> Hide rest of the row below Row 43
Rows("43:43").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Hidden = True
End Sub
Hope this helps...
Re: Disable worksheet scrolling
Thanks Koolsid...that works great!