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

Using the XIRR Function

One of the financial worksheet functions provided in Excel is the XIRR function. This is used to figure out an internal ...

Discover More

Changing How Changes are Noted in Word

Do you want to modify how Word marks changes in your document? It's easy to do, if you know where to look.

Discover More

Excel 2013 Serious Sorting (Table of Contents)

Sorting data means that you organize it in whatever order you desire. Excel's sorting feature can be used in a variety of ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Exiting a For ... Next Loop Early

If you use For ... Next loops in your macros, make sure you give a way to jump out of the loop early. That way you can ...

Discover More

Testing if a Workbook is Open

Your macros can easily open and manipulate other Excel workbooks. If a workbook you are trying to use is already in use ...

Discover More

Working while a Macro is Running

If you have a macro that takes a long time to process a workbook, you might want to continue working in Excel while the ...

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 seven minus 4?

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.