Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Always Open at 100% Zoom.
Written by Allen Wyatt (last updated August 11, 2022)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365
If you work with workbooks first worked on by your colleagues, you may be frustrated by the zoom factor applied to those workbooks by those others. For instance, if your colleague (Wanda) has a huge monitor, it wouldn't be uncommon for her to reduce the Excel's zoom factor to 75% or even 60%. The purpose, of course, is so she isn't overpowered by things that look very large at the full zoom factor.
The problem is that the zoom factor is saved with the workbook. Thus, when Wanda saves the workbook and hands it off to you, when you open it, the workbook is still displayed at whatever zoom factor Wanda last used. If you don't have the same size monitor as Wanda, then the workbook may be almost illegible on your system.
There are only two possible solutions to this problem. First, you can simply adjust the zoom factor once you open the workbook. There are a multitude of ways to do this, but the easiest involves using the Zoom control at the right side of the status bar. You can click the centerpoint on the Zoom slider and quickly get back to 100%, or you can click the percentage beside the slider to display the Zoom dialog box.
The second workaround is to create a macro that gets saved with the workbook. The macro can run every time the workbook is opened, and thereby set the zoom factor. (This macro should be added to the This Workbook code window in the VBA editor.)
Private Sub Workbook_Open() ActiveWindow.Zoom = 100 End Sub
The only problem with a macro such as this, of course, is that whenever Wanda (your colleague) opens the workbook on her system, the zoom factor is also set and she'll get just as frustrated with you as you were with her.
Perhaps a solution is to create a more involved macro—one that checks the current screen resolution and then sets the zoom factor accordingly. For instance, the following macro could be used to make the adjustments based on resolution:
Declare Function GetSystemMetrics32 Lib "user32" _ Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long Public Sub ScreenRes() Dim lResWidth As Long Dim lResHeight As Long Dim sRes As String lResWidth = GetSystemMetrics32(0) lResHeight = GetSystemMetrics32(1) sRes = lResWidth & "x" & lResHeight Select Case sRes Case Is = "800x600" ActiveWindow.Zoom = 75 Case Is = "1024x768" ActiveWindow.Zoom = 125 Case Else ActiveWindow.Zoom = 100 End Select End Sub
This routine checks the screen resolution and adjusts the window accordingly. Other resolutions and zooms may be added easily. To make the routine run automatically, just use a Workbook_Open event handler in the This Workbook code window to trigger the macro:
Private Sub Workbook_Open() ScreenRes End Sub
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11551) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Always Open at 100% Zoom.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
If you have trouble seeing the information presented in a worksheet, you can use Excel's zooming capabilities to ease the ...
Discover MoreDo you want to display a particular range of columns within the Excel window? Here's a couple ways you can accomplish the ...
Discover MoreIf you are using a mouse that has a center wheel, you can use the wheel to zoom in and out of your work. This tip shows ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2022-08-11 10:32:06
Dave Bonin
You can tailor the Workbook_Open() procedure to check if you're the one opening the workbook and take all sorts of actions specifically for you. Or other actions for users who are not you.
Besides setting zoom, the macro might scroll to cell A1 on each sheet, go to a particular sheet. hide or unhide sheets, etc...
For other users, the macro might protect the workbook.
2022-01-28 10:48:23
J. Woolley
@Akhtar Hussain
To adjust Zoom for all sheets in a workbook, substitute the following in place of the Tip's Workbook_Open code:
Private Sub Workbook_Open()
Dim Sh As Object, ASh As Object
Set ASh = ActiveSheet
For Each Sh In Sheets
Sh.Activate
ActiveWindow.Zoom = 100
'^or^ ScreenRes
Next Sh
ASh.Activate
End Sub
Also, see https://sites.google.com/view/MyExcelToolbox/
2022-01-27 10:24:29
Akhtar Hussain
Thank you J. Woolley
I have 13 worksheets in my workbook. With this code I've to run on each worksheet seperately.
Is there a way to apply code once for all 13 worksheets?
2022-01-27 09:59:04
J. Woolley
@Akhtar Hussain
Press Alt+F11, right-click ThisWorkbook, pick View Code.
2022-01-26 10:42:50
Akhtar Hussain
(This macro should be added to the This Workbook code window in the VBA editor.)
HOW to add - please show me step by step
2020-05-29 10:38:14
J. Woolley
@Paul
You can also read about my DisplayScreen (aka Screen) function in the article I wrote here:
https://wellsr.com/vba/2019/excel/calculate-screen-size-and-other-display-details-with-vba/
2020-05-28 10:25:57
J. Woolley
@Paul
The M_DisplayScreen module at https://sites.google.com/view/MyExcelToolbox/ accommodates a multi-monitor configuration. It has code to identify which screen displays ActiveWindow. The code uses Windows API GetSystemMetrics, GetActiveWindow, MonitorFromWindow, GetMonitorInfo, CreateDC or GetDC, and GetDeviceCaps. If you are familiar with VBA, perhaps you can adapt the code for your purpose.
2020-05-27 18:19:18
Paul
Bonjour Allen,
Merci pour ces belles démonstrations. Cela m'aide beaucoup.
Dans ce cas précis de calcul du zoom maximal pour la fenêtre active, à l'évènement d'ouverture du classeur Excel, la difficulté que je rencontre est que je ne travaille jamais avec un seul écran. Cela varie de 2 à 3 écrans, chacun ayant une résolution différente (celui du PC, un écran 24" et un autre 24" de nombre de lignes et colonnes différentes).
Comment faire pour savoir sur quelle écran s'ouvre la fenêtre du classeur Excel, afin d'en ajuster le zoom non-pas à la résolution de l'écran du PC, mais de l'écran sur lequel Excel se lance ?
Merci de votre aide,
Cordialement,
Paul
2019-01-14 08:59:57
Jeff C
Control button + mouse wheel is what I prefer for changing zoom in Microsoft apps. The incremental changes are not a granular as the Excel slider, though.
2019-01-12 20:37:23
Kevin
AS well as the screen size the view is also determined by the setting of Display > Scale and layout.
How can the % that this setting is on be determined to adjust for those variances?
2019-01-12 18:42:46
Mandora
Alan, macros may not be your cup-of-tea but for users, like me, who frequently use them, it is easy to set the file-save default to Excel Macro-Enabled Workbook (*.xlsm). Do this is Options > Save > Save Workbooks.
2019-01-12 13:17:11
Alan Cannon
The downside to the macro solution is that now the workbook must be saved as a macro enabled sheet such as xlsm.
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments