This post will guide you how to define a scroll area to a specific range in your worksheet in Excel. How to limit the scroll area for a worksheet via VBA macro in Excel.
Table of Contents
1. Define a Scroll Area
If you want to define a scroll range in your current worksheet, you just need to set Scroll Area properties in VBA application window. Just do the following steps:
Step1: open your excel workbook and then click on “Visual Basic” command under DEVELOPER Tab, or just press “ALT+F11” shortcut.
Step2: then the “Visual Basic Editor” window will appear.
Step3: click View menu in VBA window, and select Properties Window to show Properties pane.
Step4: locate Scroll Area property and enter the range that you want to limit the worksheet to. Such as: $A$30:$C$45
Step5: press Enter key on your keyboard, and then Close the Properties.
2. Limit Scroll Area via VBA macro
You can also use VBA Macro to define a scroll area for a particular worksheet, for example, if you want to set the scroll area A30:C45 on Sheet3, you can do the following steps:
Step1: open your excel workbook and then click on “Visual Basic” command under DEVELOPER Tab, or just press “ALT+F11” shortcut.
Step2: then the “Visual Basic Editor” window will appear.
Step3: click “Insert” ->”Module” to create a new module.
Step4: paste the below VBA code into the code window. Then clicking “Save” button.
Sub LimitScrollArea()
Sheets("Sheet1").ScrollArea = "A30:C45 "
End Sub
Step5: back to the current worksheet, then run the above excel macro. Click Run button.
3. Video: Limit Scroll Area
This video tutorial will show you how to define a scroll area to a specific range in your worksheet throught VBA Macro in Excel.
Leave a Reply
You must be logged in to post a comment.