Navigating on a worksheet

  • Thread starter Thread starter Bill
  • Start date Start date
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,
 
You can do this by running a very simple macro:

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

HTH. Best wishes Harald
 
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
 

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

Back
Top