Hi guys,
I am trying to lock the scroll areas in my work book. There are several sheets, each with a different area to be restricted.
I tried the sheet properties in the VBA window, only to find these values aren't carried over when the workbook is reopened. So I am trying my luck with some code. I've put the code listed below in "ThisWorkbook" module, so it operates upon the Workbook opening.
The code works restricting vertical scroll area, but horizontal scroll is still "unlimited"...? There are no errors, the horizontal scroll just keeps scrolling past where its supposed to stop. Can anyone shed some light on this one?
Everyone's help is always appreciated, I've been learning lots from this forum.
I've also tried:
I am trying to lock the scroll areas in my work book. There are several sheets, each with a different area to be restricted.
I tried the sheet properties in the VBA window, only to find these values aren't carried over when the workbook is reopened. So I am trying my luck with some code. I've put the code listed below in "ThisWorkbook" module, so it operates upon the Workbook opening.
The code works restricting vertical scroll area, but horizontal scroll is still "unlimited"...? There are no errors, the horizontal scroll just keeps scrolling past where its supposed to stop. Can anyone shed some light on this one?
Everyone's help is always appreciated, I've been learning lots from this forum.
Code:
Worksheets("Worksheet 1 Name").ScrollArea = "$A$1:$U$54"
Worksheets("Worksheet 2 Name").ScrollArea = "$A$1:$U$465"
'etc...
I've also tried:
Code:
Worksheets("Worksheet 1 Name").ScrollArea = "A1:U54"
Worksheets("Worksheet 2 Name").ScrollArea = "A1:U465"
'etc...