Loading
Excel.Tips.Net ExcelTips (Menu Interface)

Always Open at 100% Zoom

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.

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

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.

Related Tips:

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

 

Leave your own comment:

*Name:
Email:
  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*Text:
*What is 5+3 (To prevent automated submissions and spam.)
 
 
           Commenting Terms

Comments for this tip:

DavideA    03 Mar 2015, 06:03
Well, I need help.
I have a case where I put the code with checks the current screen resolution and then sets the zoom.
The declaretion Function GetSystemMetrics32 Lib "user32" _
    Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long
doesn't work.
this is my workbook:


Declare Function GetSystemMetrics32 Lib "user32" _
    Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long

--

Private Sub Workbook_Open()
ScreenRes

With Worksheets("Ordine")
.Protect "•••••••", userinterfaceonly:=True
.EnableOutlining = True
End With
End Sub

--

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 Is = "1440x900"
            ActiveWindow.Zoom = 30
        Case Else
            ActiveWindow.Zoom = 100
    End Select
End Sub

--

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("Amministrazione").Range("A1") = Now()
End Sub
Henrik Madsen    13 Jun 2014, 04:50
Well, this only sets the active sheet zoom level when opening the workbook, how do we set all of the sheets to the same zoom level when opening the workbook ???
 
 

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us

 

Advertise with Us

Our Privacy Policy

Our Sites

Tips.Net

Beauty and Style

Cars

Cleaning

Cooking

DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)

Gardening

Health

Home Improvement

Money and Finances

Organizing

Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Our Products

Helpful E-books

Newsletter Archives

 

Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2016 Sharon Parq Associates, Inc.