View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Prevent PageDown

Hi OJ,

You can set the worksheet's ScrollArea property to restrict navigation to
the requisite area, e.g.:

Sub Tester()
Dim ws As Worksheet

Set ws = ActiveSheet <<=== Change
ws.ScrollArea = "A1:F10" <<=== Change
End Sub

To remove the scroll restriction, set the scrollarea to the empty string
("").

---
Regards,
Norman



"OJ" wrote in message
oups.com...
Hi,
I've designed a sheet so that the unused columns and rows are hidden,
and the usuable area of the sheet is displayed completely in the
activewindow. It works ok but when a user presses PageDown (or
Shift+PageDown or Ctrl+PageDown) they are presented with an entirely
grey screen. How can I avoid this happening? I thought a
Selection_Change event but that does not fire, which in hindsight makes
sense. How can I ensure that the activewindow ALWAYS displays the
visible area?

OJ