What the video covers
Set or remove a worksheet ScrollArea using the VBA Properties panel and make it persistent with a Workbook_Open macro. Applies to workbooks where using macros is acceptable.
Watch the video on YouTubeStep-by-step instructions
- Identify the range
Decide the exact cell range you want users confined to (example: A1:M50). - Open the sheet's code/properties
Right-click the sheet tab and choose View Code to open the VBA editor. - Show Properties and set ScrollArea
If the Properties panel isn't visible in the VBA window, press F4. In Properties, find ScrollArea and type your range (for example A1:M50), then press Enter. - Test the restriction
Close the VBA editor and try to scroll or select cells outside the specified range; movement should be blocked at the boundary. - Make the setting persistent (optional)
To reapply ScrollArea automatically each time the workbook opens, double-click ThisWorkbook in the VBA editor and add a Workbook_Open procedure that sets Sheets("SheetName").ScrollArea = "A1:M50", adjusting the sheet name and range as needed. - Save as macro-enabled if you used a macro
Use Save As and choose the Excel Macro-Enabled Workbook (.xlsm) format so the Workbook_Open code runs on open. - Remove or expand the restriction later
To unlock full scrolling, clear the ScrollArea value in the Properties panel (leave it empty) or change the range, then close the VBA editor.
Watch the video
Play tutorial
Why it matters
Preventing users from scrolling into empty rows and columns keeps focus on your dashboard or report and gives the workbook a cleaner, application-like feel.
Check your result
After setting ScrollArea, attempt to scroll or enter a cell outside the defined range — Excel should not allow movement outside that range. If you used the Workbook_Open macro, close and re-open the file and confirm the restriction remains.
Troubleshooting
If the ScrollArea resets after closing the workbook, ensure you added the Workbook_Open code in ThisWorkbook and saved the file as a macro-enabled workbook (.xlsm). If the Properties pane is not visible, press F4 in the VBA window to show it. If macros are disabled by security settings, enable them for this file or adjust trust settings.