How to lock the screen to prevent scrolling in an Excel worksheet?
In Microsoft Excel, it is normal for you to freely scroll through a worksheet in any direction, allowing access to all cells and data. However, there are situations where you may want to restrict user navigation strictly to a certain area, such as cells in the range A1:M100. This is particularly useful when sharing files with others, protecting forms, or keeping users focused only on relevant sections of the worksheet. So, how can you quickly and conveniently set up a screen lock that prevents scrolling beyond a specific area of your Excel worksheet?
Lock the worksheet screen to prevent scrolling by setting the properties manually
Lock the worksheet screen to prevent scrolling with VBA code
Lock the worksheet screen to prevent scrolling with Kutools for Excel with one click
Alternative: Highlight out-of-area cells with Excel formulas (visual warning)
Lock the worksheet screen to prevent scrolling by setting the properties manually
Excel provides a built-in feature that lets you manually restrict the scrollable area of a worksheet. By setting the ScrollArea property in the worksheet's Properties dialog box, you can limit navigation so that users can only interact with a defined range, such as A1:M100. This method is straightforward, but it is available only while the workbook is open and requires access to the Developer tools.
1. Open the worksheet you intend to restrict. This ensures the properties you set will apply to the correct sheet.
2. Navigate to the Developer tab in the Excel ribbon, then click Properties. In the displayed Properties dialog box, find the ScrollArea field and enter your desired range (for example, A1:M100). This setting restricts activity to within the area you specify. See screenshot:

3. Close the Properties dialog box to save your changes. After this, you will notice that clicking, scrolling, or selecting cells outside of the specified area is no longer possible in the worksheet.
Notes:
- The cell range entered in the ScrollArea box must be continuous (e.g., A1:M100). Non-adjacent ranges cannot be set here.
- When you want to remove the scrolling limitation, simply delete the range reference from the ScrollArea field in Properties and confirm the change. This will restore navigation to the entire worksheet.
- Be aware that this scroll restriction does not persist after closing and reopening the workbook. You will need to reapply the setting if you intend for it to remain active.
Tips: If the Developer tab is not visible in your Excel ribbon, you may need to enable it first. For step-by-step instructions, see How to show/display the developer tab in Excel 2007/2010/2013 Ribbon?.
Applicable scenarios: This solution is ideal for quick sheet protection in one-off projects and drafts where persistent restrictions are not necessary. However, its main limitation is that users must reset it after each reopening of the workbook.
Lock the worksheet screen to prevent scrolling with VBA code
For users who require more flexibility or want to automate the locking process, using VBA (Visual Basic for Applications) is an effective alternative. With a simple script, you can quickly set or remove scroll area restrictions in any worksheet. This method is especially useful if you repeatedly need to lock the same area or wish to apply these settings as part of a larger macro workflow.
1. Press ALT + F11 to launch the Microsoft Visual Basic for Applications window. This is where you can write and manage VBA code in Excel.
2. In the VBA window, click Insert > Module. Paste the following code into the opened module. Please make sure to adjust the worksheet name and scroll range in the code to match your requirements.
VBA code: Lock worksheet screen to prevent scrolling
Private Sub Workbook_Open()
Sheets("Sheet1").ScrollArea = "A1:M100"
End Sub
3. To run the code, press F5 while the module is active. The scroll area for the sheet is now restricted to the specified range.
Notes:
- Replace Sheet1 in the code with your actual worksheet name, and A1:M100 with your desired scrollable area.
- If you wish to unlock the worksheet and allow access to all cells, paste and run the following code in the same manner:
VBA code: Cancel the lock of worksheet screen
Private Sub Workbook_Open()
Sheets("Sheet1").ScrollArea = ""
End Sub
Practical tips: VBA code can be saved in your workbook to automate scroll area settings every time you open the file. For persistent restrictions, consider adding your VBA code to the Workbook_Open event in the ThisWorkbook code window. Remember to save your workbook as a macro-enabled file (.xlsm) so that the code runs correctly.
Troubleshooting: If you receive a runtime error, double-check your worksheet name and scroll area range. Ensure macros are enabled in Excel's Trust Center settings, and always make backup copies of important workbooks before running unfamiliar code.
Applicable scenarios: VBA solutions are suited for advanced users, automated tasks, and environments where repeatable, customized restrictions are needed. However, enabling macros may be restricted in highly secure organizational settings.
Lock worksheet screen to prevent scrolling with Kutools for Excel by one click
Kutools for Excel comes equipped with a handy Set Scroll Area utility, allowing you to restrict navigation to a certain area in your worksheet with a single mouse click. This feature is easy to use, doesn't require any manual coding, and has the added benefit of quickly hiding areas outside your selected range, which simplifies sheet interaction and improves focus.
After installing Kutools for Excel, follow these steps for instant scroll area restriction:
1. Select the cell range you want users to be limited to (for example, A1:M100). Next, click Kutools > Show & Hide > Set Scroll Area. See screenshot:

2. Immediately, only your chosen cells are interactableβother areas are hidden and inaccessible for scrolling, editing, or selection. See screenshot:

Note: To restore visibility to all worksheet cells, go to Kutools > Show & Hide > Unhide All Ranges as shown below:

This approach is user-friendly and best suited for those needing a quick restriction or for sharing protected forms and templates. It is especially practical for team collaborations, educational activities, or managing worksheet navigation for less experienced users.
Download and free trial Kutools for Excel Now!
Advantages: Kutools simplifies scroll area setup and removal without needing manual coding or advanced Excel skills. Changes take effect immediately and can be toggled off with just a click. It's also ideal for businesses, educators, and anyone needing to frequently restrict worksheet areas.
Precautions: If you save and close the workbook, re-opening will require you to reapply the scroll area restriction using Kutools or other methods. For ongoing worksheet protection, combine scroll area restriction with sheet protection features.
Demo: Lock worksheet screen to prevent scrolling with Kutools for Excel by one click
Alternative: Highlight out-of-area cells with Excel formulas (visual warning)
In some cases, instead of fully restricting access, you might want to visually mark cells outside your intended working area and alert users if they accidentally edit out-of-bounds cells. This can be achieved using Excel's Conditional Formatting together with simple formulas.
1. Select the entire worksheet or a broad area that may contain unwanted edits.
2. Go to Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format.
3. In the formula box, enter the following formula to highlight any cell outside the target range (for example, outside of A1:M100):
=OR(ROW()<1,ROW()>100,COLUMN()<1,COLUMN()>13) 4. Choose a formatting style (such as red fill or border) and click OK. This will visually warn users when they access areas beyond your designated worksheet zone. Note: The formula above is tailored for an area from row1 to row100 and column1 (A) to column13 (M).
Practical tip: Conditional Formatting is not a security featureβusers are still able to interact with cells outside your area, but it's a helpful visual cue for forms or data collection environments as a soft restriction.
Troubleshooting and suggestions: If you find your scroll area restriction is not holding after reopening your workbook, remember that both manual property settings and Kutools settings require you to reapply them each session. For lasting effects, use VBA in a workbook macro, or consider using sheet protection with selective unlocking of required cells. Always communicate to worksheet users regarding any navigation restrictions to avoid confusion.
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.
- All-in-one suite β Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license β set up in minutes (MSI-ready)
- Works better together β streamlined productivity across Office apps
- 30-day full-featured trial β no registration, no credit card
- Best value β save vs buying individual add-in