Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Always Open at 100% Zoom.
Written by Allen Wyatt (last updated May 23, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003
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 zoom factor on Excel 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 involve the Zoom setting on the Formatting toolbar, or using the scroll wheel on your mouse. (On some systems you may need to hold down the Ctrl key in order for the scroll wheel to adjust the zoom factor.)
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 (2668) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) 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!
Do you get an error when you try to insert just one more chart in your workbook? It could be because of an obscure ...
Discover MoreRuminations and reflections about significant digits in Excel. Includes examples of how significant digits can affect the ...
Discover MoreExcel displays, by default, a row label or heading at the left side of each row on the screen. As you scroll down the ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2024-08-19 08:00:47
Sara
This is a really useful bit of coding - thank you!
Is there a way to apply the first to the whole workbook?
Private Sub Workbook_Open()
ActiveWindow.Zoom = 100
End Sub
(I've tried ActiveWorkbook but that didn't work!)
Many thanks!
2022-12-10 01:52:47
c
The first solution work be perfect for my needs.
Private Sub Workbook_Open()
ActiveWindow.Zoom = 100
End Sub
However it won't work because when the macro runs the there is no active window yet. Once my macro runs through completely then the worksheet loads afterwards. How do I get a macro to run after the worksheet is loaded up?
2020-11-26 16:56:36
Mark
Hello Allen, thanks for the tip! This little snippet of code might just be what I need.
Question: I note that the two resolutions that you used in your code are both 4:3 aspect ratio which probably isn't all that common anymore. Having said that, there are probably a few monitors kicking around in that format. Is there a way to modify the code so that it will detect the resolution of 'whatever' monitor it is opened on and adjust accordingly? My workbook could possibly be used by anyone on the planet so I would like to prepare for any contingency.
I guess my only other choice would be to modify the code to include all possible resolutions(?).
Thanks again! Look forward to your reply.
2020-10-29 01:07:08
anna
what is the definition of 100% zoom?
thankyou...
Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon 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