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

Changing Page Number Format

Need your page numbers to not appear as regular Arabic numerals? Here's a way to get them to appear in a different ...

Discover More

Disabling Printing

Don't want your worksheets to be printed out? You can make it a bit harder to get a printout by applying the techniques ...

Discover More

Dividing the Screen Unevenly between Two Workbooks

When working with multiple workbooks, you'll typically want to resize the workbook windows so you can see the data from ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Determining the Current Directory

When you use a macro to do file operations, it works (by default) within the current directory. If you want to know which ...

Discover More

Importing Based on a Partial File Name

A common task for macros is to open and process a file you want imported into your workbook. If you need to identify the ...

Discover More

Adjusting a Path Based on System and User

It is not uncommon to set variables in a macro based on other values, such as time or date. You could also set variables ...

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 9 + 2?

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.