Connect with us

Guide

How to Limit Access to Rows and Columns With VBA in Excel

Published

You can temporarily restrict the number of rows and columns that can be used in a worksheet by using the Visual Basic for Applications (VBA) tool provided by Microsoft. In this demonstration, you will modify the settings of a worksheet so that the maximum number of rows that can be used is 30, and the maximum number of columns that can be used is 26. The procedure is as follows:

Read Also: How to Hide Worksheets in Microsoft Excel

How to Limit Access to Rows and Columns With VBA in Excel

This is the procedure to follow:

1. Open a blank Excel file. Right-click the Sheet1 sheet tab that’s located at the very bottom of the screen. Select View Code from the available menu options.

How to Limit Access to Rows and Columns With VBA in Excel

2. The editor window for Visual Basic for Applications (VBA) will open now. Find the Properties area in the left rail and click there.

How to Limit Access to Rows and Columns With VBA in Excel

3. Click the blank box in the right column of the ScrollArea row located under the heading Properties, and then put A1:Z30 into it.

How to Limit Access to Rows and Columns With VBA in Excel

4. Use the standard procedure to save your worksheet by going to the File menu and selecting Save. Choose “Close and Return to Microsoft Excel” from the “File” menu.

Trending