Limit scroll area permanently

leopardhawk

Well-known Member
Joined
May 31, 2007
Messages
611
Office Version
  1. 2016
Platform
  1. Windows
Hello forum friends, I am so frustrated but have nowhere else to turn. Everything I have tried doesn't work as it should. I am trying to limit the scroll area on a dozen or so sheets in my workbook but I'll focus on one for now. I have searched the Internet and this site, watched several videos and tried every solution as they are presented. I was able to get it to work just fine in VBA by going to the 'ScrollArea' in the Properties Window for the sheet in question. The problem is that when I save the file, close and re-open it, the scroll area is right back where it started, with users being able to scroll wherever they want to on the sheet, far beyond where I want them to go. I simply can't understand why it won't stay permanent!

I even tried a couple of VBA code suggestions and they didn't work at all, even after I ran the macro. Any suggestions are much appreciated. Thanks!
 
You would put it in a normal module and call it. Done.
If you later decide to add a failsafe by calling it with the Open event, you could add that.
VBA Code:
With Sheets("Sheet19")
    Range(.Range("U:U"), .Cells(1, Columns.Count)).EntireColumn.Hidden = True
    Range(.Range("19:19"), .Cells(Rows.Count, 1)).EntireRow.Hidden = True
End With
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
@mikerickson where would I place this code? Sheet 19 is the one in question and the range I want to limit users to not be able to scroll outside of is A1:Q18.
Hi LeopardHawk. Did you ever get this working? I just started a thread on this exact same issue. I'm not sure why such simple code won't work. I keep hoping some VBA master will help us solve this, but so far no one has come up with a solution. I'm starting to think it's some odd glitch in Excel. Please do let me know if you've found a solution. By the way, here's my thread. Sounds like the same issue you're having. VBA Mystery
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,301
Members
449,078
Latest member
nonnakkong

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top