Navigating on a worksheet

B

Bill

Hi,
I have a work sheet which I hope to us in my office.
All the necessary information is on the screen when the user opens the sheet.
Can I prevent the user from panning to the right, I know you can switch off
the scroll bars but this doesnt stop the user from panning to the right.
Similarly can I prevent the user from scrolling past a certain cell, say
cell 150.
Regards,
 
H

Harald Staff

You can do this by running a very simple macro:

Sub RestrictTheWorkers()
Sheets(1).ScrollArea = "A1:M150"
End Sub

HTH. Best wishes Harald
 
G

Gord Dibben

See Harald's reply about the scrollarea for a manually-run macro.

Or to automatically run..........................

Since the scrollarea method does not stick between sessions you will have to
reset it each time you open the workbook.

You will place the code into a WorkBook_Open Sub in ThisWorkbook module
and specify which worksheet if only one sheet required.

Adjust the sheetname and range to suit.

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

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

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


Gord Dibben MS Excel MVP
 
Top