Scroll Lock in Protected Excel Worksheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to stop users being able to scroll through mouse in protected sheets.
Can someone please help.
 
Might just be easiest to hide the extra rows and columns then protect the
worksheet.

But via VBA if you want to go that route.......................

You can set the ScrollArea so users cannot move out of that area.

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

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

Private Sub WorkBook_Open()
Sheets("YourSheet").ScrollArea = "A1:M35"
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:M35"
End With
End Sub

To unset this area................

Sub Scroll_All()
Sheets("YourSheet").ScrollArea = ""
End Sub


Gord Dibben MS Excel MVP
 
Hey I am new to this. I can get a reply box but I can't a new question box?
somebody help!
 
Back
Top