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.

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

Printing Portions of Mail Merged Documents

When you use a data source to create a bunch of documents in a mail merge, you might not want to print all the documents ...

Discover More

Removing Duplicate Rows

Too much data in your worksheet? Does too much of that data duplicate other data? Here's how to get rid of the duplicates so ...

Discover More

Hyperlinks Not Found

When creating hyperlinks in a document, it is important to remember the difference between absolute and relative referencing. ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

Calculating Only the Active Workbook

When you enter information into a workbook, Excel automatically recalculates every worksheet in every open workbook on your ...

Discover More

Copying Worksheet Code Automatically

When creating a workbook to be used by others, you may want any worksheets they add to the workbook to contain some special ...

Discover More

Stepping Through a Macro with a Worksheet Visible

When developing a macro, it is often necessary to step through the various code lines so you can see what is happening on 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 8Mpixels. 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 6 - 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.