Written by Allen Wyatt (last updated June 26, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365
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:
Figure 1. The Properties window in 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 ScrollArea 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 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 ensured that the scroll area is exactly what you want.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10815) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Limiting Scroll Area.
Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!
One of the most basic of programming structures is the conditional structure: If ... End If. This tip explains how this ...
Discover MoreIf you keep on-going data in a worksheet, some of your data�"over time�"may need to be deleted. If you have an ...
Discover MoreWhen creating macros, you often need to process numbers in various ways. VBA allows you to convert a numeric value to an ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2022-11-24 21:21:41
Tomek
The tip says:
"You should be aware that the ScrollArea property is reset each time you restart Excel. "
Actually, this setting will be reset if you just close and reopen the file, without closing Excel. (at least in MS365).
Also, be aware that if you set the ScrollArea many navigation shortcuts will be deactivated, e.g., End + Arrow key or Ctrl+End, if the navigation would bring you outside the ScrollArea. In other words it will not bring you to the edge of the scroll area, contrary to what you may expect.
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2023 Sharon Parq Associates, Inc.
Comments