Scroll Lock for selected multiple sheets

K

Keyrookie

Help please,

I'm trying to limit the scroll area of several sheets but I also need
other sheets to scroll normally. I'm using this formula in the VBA
(ThisWorkbook):

Private Sub WorkBook_Open()
Sheets("Jan").ScrollArea = "A1:M52"
End Sub

This works fine for the "Jan" sheet but I have several others that I
need to limit the scroll area as well. I tried placing the above
formula in each sheet that I want to limit but upon opening the
workbook I get an Runtime Error.

What's the solution?

K
 
D

Dave Peterson

This code goes in the ThisWorkbook module--not behind each worksheet.

Private Sub WorkBook_Open()
Sheets("Jan").ScrollArea = "A1:M52"
sheets("Feb").scrollarea = "a12:q34")
sheets("Mar").scrollarea = "x99:z108")
'...etc
End Sub
 
K

Keyrookie

Dave said:
This code goes in the ThisWorkbook module--not behind each worksheet.

Private Sub WorkBook_Open()
Sheets("Jan").ScrollArea = "A1:M52"
sheets("Feb").scrollarea = "a12:q34")
sheets("Mar").scrollarea = "x99:z108")
'...etc
End Sub

Keyrookie wrote:-

Thank you Dave, that did the job. You're the MAN!
 

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

Top