Get our FREE VBA eBook of the 30 most useful Excel VBA macros.Īutomate Excel so that you can save time and stop doing the jobs a trained monkey could do.īy entering your email address you agree to receive emails from Excel Off The Grid. Whenever the file opens, the Workbook Open event triggers first, which resizes the spreadsheet to fit the window. Save the file as a macro-enabled workbook, the close it.
The code will look something like this Sub Macro3() ' ' Macro3 Macro ' 'Ĭopy that code, and insert it into the Workbook Open event for ThisWorkbookĭelete the recorded macro and the button, as we no longer need them. View the recorded macro code within the Visual Basic Editor ( Developer -> Visual Basic Editor) Let’s make the resizing happen automatically. That’s almost an acceptable solution, but we can go one step further.įinally, we get to the good stuff. Now it is possible to resize the spreadsheet to the window just by clicking the button. Next, create a button using Developer -> Insert -> Form Control -> Button (Form Control).Īssign the macro created above to that button. Select the range of cells then click View -> Zoom to Selection.Ĭlick in Cell A1 to return the selection to a single cell.Ĭlick the Stop Recording button from the Developer Tab. Right-click on a blank part of the ribbon and select Customize the Ribbon… from the menuįrom the Excel Options window click Customize Ribbon, enable the Developer option then click OK.Ĭlick the Record Macro button within the Developer Tab. You will need to use the Developer Tab, follow these instructions if you have not already enabled it. If you’re not a VBA-wiz, we can turn to the Macro recorder to automate the process of selecting a range then using Zoom to Selection. If we could automate this feature, it would be a pretty good solution. This option also exists within the Zoom window, but for a reason which is unknown to me, it is called by a different name Fit to selection. The user selects the range of cells to fill the screen, then clicks the Zoom to Selection button. Manually Zoom to SelectionĪ slightly better option for this situation was Zoom to Selection. Whilst manually resizing the spreadsheet was an option, it wasn’t quite the seamless user experience I was looking for. Hold the Ctrl key while moving the scroll wheel backward and forward. If you have a mouse with a scroll wheel (which most do) there is another option.
By clicking and dragging the slider it is possible to get any size between 10% and 400%. The and buttons will move the zoom level by 10% increments. The zoom setting is also available on the Status Bar Entering a custom size outside of this range will trigger the following error message.
There are multiple preset options, plus a Custom option to select any size between 10% and 400%. View -> ZoomĪfter clicking on the button, the Zoom window will appear. The zoom setting is available on the View Ribbon. This setting is available in three places: There is a zoom setting on Excel, which each user can apply themselves. Let’s consider each of these one by one Manually zoom in/out Click a button to resize the spreadsheet.Here are the four stages of my thought process: Would the small screen managers have to scroll, or would the big screen managers have a lot of white space? That was a tough choice. Some lucky enough to have the same as me, while others had the older smaller ones.
I had created a dashboard which fitted nicely on my new big screen, but my managers, had a mix of screen sizes. it was causing my managers problems and therefore causing me problems. Wow, what a day that was! I set about creating bigger dashboards with more charts and tables, more space meant more insight, right?!? I was sure the praise would come flooding in.īut it wasn’t long until my new screen was causing me problems. I was once lucky enough to be the recipient of a new, bigger screen. A new keyboard, a bigger screen, even a mouse mat with a wrist rest was enough to make everyone else jealous. It didn’t matter what the equipment was it just had to be better than everybody else. Every office I have ever worked in has been an equipment battleground.