Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Limiting Scroll Area.

Limiting Scroll Area

by Allen Wyatt
(last updated March 14, 2015)

5

When putting together a worksheet for others to use, you may want to limit the cells that the user can access. One esoteric way to add limits is to use the following steps:

  1. Right-click the sheet tab for the sheet on which you want to place a limit.
  2. In the resulting Context menu, choose View Code. The VBA editor appears, displaying the code window for the worksheet whose tab you right-clicked.
  3. If the Properties window is not visible, press F4.
  4. In the Properties Window, place the insertion point in the box to the right of the Scroll Area property. (See Figure 1.)
  5. Figure 1. The Properties window in the VBA Editor.

  6. Enter the range in which you want navigation possible. For instance, if you want the user to only be able to access the cells in the range A3:D15, then enter that range.
  7. Close the VBA Editor.

That's it; you can no longer move to or select cells outside the range you specified in step 5. The range you enter must be a contiguous range; you cannot enter a non-contiguous group of cell addresses.

You should be aware that the scroll area property is reset each time you restart Excel. So, if you want the scroll area to be automatically set every time you use the worksheet, you may want to set up a macro to do the modification to the the property. You can do that with a simple one, like this:

Private Sub Worksheet_Activate()
     ActiveSheet.ScrollArea = "A3:D15"
End Sub 

The macro is automatically run whenever the worksheet is activated, so you are ensure that the scroll area is exactly what you want.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10815) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Limiting Scroll Area.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Scanning and Fixing System Files

Is your system running a bit flakey at times? If you think the culprit might be a problem with some of your system files, ...

Discover More

Specifying an Order for Page Printing

When the data on a worksheet occupies more than one printed page, Excel can easily determine where the first page of data ...

Discover More

Columns in a Text Box

Want to divide a text box into columns? Word doesn't allow you to do this, but there are ways to work around the limitation.

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

Mouse Click Event in VBA

Need to know if a particular cell is clicked with the mouse? Excel has no particular event handler for clicking in this ...

Discover More

Deleting Old Data from a Worksheet

If you keep on-going data in a worksheet, some of your dataâ€"over timeâ€"may need to be deleted. If you have an ...

Discover More

Macro for Month Name

Need to know how to generate a full month name based on a date? It's easy to do, as discussed in this tip.

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is three more than 5?

2017-06-02 13:49:06

Mike

I don't have a problem with the resetting of the scroll area, as I do that each time an entry is added or deleted...as well as the scroll area being initially set upon the spreadsheet opening. The problem I have is that, after hiding rows that don't meet the user's search criteria, I can scroll down and then back up ONLY ONE TIME...after that, the scrolling is locked and I'm having a hard time working out why that's the case. Since it's possible to scroll one time initially after "filtering" is complete, my thought is that it has something to do with my code -- otherwise I'm guessing that it wouldn't work whatsoever. I was wondering if there's something special in VBA that needs to be done when trying to scroll through a filtered list ( though, as I had stated in my initial post, it's NOT AutoFiltered but rather simply has rows hidden that don't conform to the user's search parameters ) that I might be missing.

Again, any input or suggestions would be GREATLY appreciated.


2017-06-02 11:15:23

Michael (Micky) Avidan

@To whom it may concern,
To the best of my knowledge, the scroll area property resets each time we close/re-openstart the Workbook.
--------------------------
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” Excel MVP – Excel (2009-2017)
ISRAEL


2017-06-02 09:40:00

Mike

I don't have a problem with the resetting of the scroll area, as I do that each time an entry is added or deleted...as well as the scroll area being initially set upon the spreadsheet opening. The problem I have is that, after hiding rows that don't meet the user's search criteria, I can scroll down and then back up ONLY ONE TIME...after that, the scrolling is locked and I'm having a hard time working out why that's the case. Since it's possible to scroll one time initially after "filtering" is complete, my thought is that it has something to do with my code -- otherwise I'm guessing that it wouldn't work whatsoever. I was wondering if there's something special in VBA that needs to be done when trying to scroll through a filtered list ( though, as I had stated in my initial post, it's NOT AutoFiltered but rather simply has rows hidden that don't conform to the user's search parameters ) that I might be missing.

Again, any input or suggestions would be GREATLY appreciated.


2017-06-02 04:07:11

Michael (Micky) Avidan

@To whom it may concern,
To the best of my knowledge, the scroll area property resets each time we close/re-openstart the Workbook.
--------------------------
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” Excel MVP – Excel (2009-2017)
ISRAEL


2017-06-01 09:54:17

Mike Hammock

I have a question relative to setting scroll areas on a spreadsheet...but it's a rather complex and convoluted situation. I'm trying to allow a user to filter some information and then only allow scrolling through the filtered range. While that works, if the number of "hits" with the filter exceeds the number of rows visible on the screen, the user isn't allowed to scroll beyond the visible area of the screen, which is obviously not the result I'm after. Setting the scroll area works just fine, but the inability to scroll vertically through all of the "hits" is something I haven't worked out as of yet. I'm NOT using AutoFilter, as it caused problems with another part of my spreadsheet -- rather I've created a routine which loops through all of the entries on my spreadsheet and hides any that don't match my search criteria. I can go into greater detail in an e-mail if that would help...but I've hit a proverbial brick wall and can't seem to make any forward progress with this issue. Might you have any suggestions as to how to proceed...or what I might try that I haven't already tried ?


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.