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: Zooming With the Keyboard.
Written by Allen Wyatt (last updated October 3, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003
For most purposes, Excel allows you to issue commands and perform functions by using either the mouse or the keyboard. Unfortunately, Excel does not provide "equal access" for all commands. For instance, it is relatively easy to zoom in or out using the mouse, but there is no easy way to do it using the keyboard (other than using the keyboard to traverse the menus and select a zoom setting).
If you want the ability to zoom in or out easily using the keyboard, the only way to get it is to create a macro and then assign the macro to a keyboard combination. The following VBA macro (MyZoomIn) allow you to zoom in to (enlarge) a worksheet by 10%:
Sub MyZoomIn() Dim ZP As Integer ZP = Int(ActiveWindow.Zoom * 1.1) If ZP > 400 Then ZP = 400 ActiveWindow.Zoom = ZP End Sub
Notice that the macro only allows you to zoom in up to 400%. This is because Excel allows you to only zoom that high, and any higher would generate an error. A slight variation on the same theme results in a macro I call MyZoomOut. It zooms out of (reduces) a worksheet by 10%:
Sub MyZoomOut() Dim ZP As Integer ZP = Int(ActiveWindow.Zoom * 0.9) If ZP < 10 Then ZP = 10 ActiveWindow.Zoom = ZP End Sub
This macro sets the bottom boundary at 10%, which is the smallest you can go. Any smaller, and Excel would generate an error again.
The final trick to make these macros really useful is to assign them to a keyboard combination. You can then quickly zoom in or out by 10% with a simple keystroke. The following are the steps you can use to assign a macro to a keyboard combination:
Figure 1. The Macro Options dialog box.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2731) 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: Zooming With the Keyboard.
Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!
A little green triangle in the corner of a cell means that Excel thinks there is an error with the cell contents. If ...
Discover MoreHave you ever opened Excel to find that the window you saw yesterday is not the same as it is today? Sometimes, for ...
Discover MoreWant to get a little bit of sound with your data? Excel can provide audible feedback that you may find helpful. Here's how.
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2022-02-01 01:00:06
Ander
Alan, you're a genius. This is so helpful to us lonely types still using the pre-"ribbon" [shiver!] version of Excel. Thanks!
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