View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
jackrobyn1 jackrobyn1 is offline
external usenet poster
 
Posts: 25
Default limit the scroll of a worksheet

Thanks!!! works a treat, great.

"Tom Hutchins" wrote:

From an earlier reply to a similar question:

You can set the scrollarea to a fixed range. Since the scrollarea method
does not stick between sessions you will have to reset it each time you open
the workbook.

You may wish to place the code into a WorkBook_Open Sub in the ThisWorkbook
module of the workbook and specify which worksheet, if only one sheet is
required.
Adjust the sheetname and range to suit.

Private Sub WorkBook_Open()
Sheets("YourSheet").ScrollArea = "A1:P63"
End Sub

Or also in the Thisworkbook module to limit scrollarea on all sheets.

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
With ActiveSheet
.ScrollArea = "A1:P63"
End With
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Hope this helps,

Hutch

"jackrobyn1" wrote:

how do I limit the scroll area of a worksheet to only view the area:-
columns =a to P
and
rows = 1 to 63

i need this so the page doesnt scroll to an unused area of the worksheet.