Do you know that Excel allows us to zoom to a specified area in your work sheet? Yes, you heard it right. Suppose, you have an Excel sheet and while doing demo or so, you want to zoom to specified area, it can be done easily. Our very own Excel MVP Jordan Goldmeier lets us know how to auto resize an Excel spreadsheet with VBA and that too with just a single click.
So, without wasting any more time, let us jump in to the implementation!
To know auto resizing an Excel spreadsheet, there are four steps to be followed as,
That’s it! These 4 steps as explained by Excel MVP Jordan Goldmeier lets you auto resize an Excel spreadsheet. Let us look in to these steps in detail.
First step is to select the area which you want to zoom or auto resize and give it a name using Name Box.
Copy and Paste the below VBA Code in Microsoft Visual Basic for Applications editor,
Public Sub FitToScreen()
ActiveWindow.Zoom = True
Jordan explained the each and every line of the code in the video very clearly. He also mentioned another code in the video, but that seems to be crashing some of the Excel sheets (but can be used).
Now we need to assign the created Macro to the button
What are you looking for? We are done with the steps which we are supposed to do. Now, click on the button and you would see that, selected area has been zoomed.
By, following all these steps one by one, you are able to auto resize an Excel Spreadsheet with just a small VBA code simply!
Wow! It is very interesting. Is not it? Then what are you waiting for? If you have anything to add, please do share with us through comments.
Please log in again. The login page will open in a new tab. After logging in you can close it and return to this page.