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: Zooming with the Keyboard.

Zooming With the Keyboard

Written by Allen Wyatt (last updated November 2, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


7

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) allows 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:

  1. Press Alt+F8. Excel displays the Macro dialog box, which includes a list of your defined macros. (MyZoomIn and MyZoomOut should be among them.)
  2. Select the MyZoomIn macro.
  3. Click on Options. Excel displays the Macro Options dialog box. (See Figure 1.)
  4. Figure 1. The Macro Options dialog box.

  5. In the Shortcut Key box, specify the shortcut you want to use. For instance, if you want to use Ctrl+I, you would enter an I in the Shortcut Key box.
  6. Click on OK.
  7. Select the MyZoomOut macro.
  8. Click on Options. Excel again displays the Macro Options dialog box.
  9. In the Shortcut Key box, specify the shortcut you want to use. For instance, if you want to use Ctrl+O, you would enter an O in the Shortcut Key box.
  10. Click on OK.
  11. Click on Cancel to close the Macro dialog box.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12582) 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: Zooming with the Keyboard.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Turning Off Dynamic Menus

You may want to adjust the way that Excel displays its various menus. This tip explains how you can turn off the dynamic ...

Discover More

Text Doesn't Wrap at Margin in Draft View

If you are using Word in Draft view, and the text on the screen doesn't wrap at the right margin like it should, the ...

Discover More

Separating Cells Based on Text Color

If the font color used for the data in your worksheet is critical, you may at some time want to move cells that use a ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

Zooming In On Your Worksheet

If you have trouble seeing the information presented in a worksheet, you can use Excel's zooming capabilities to ease the ...

Discover More

Nifty Zooming

If 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 More

Displaying a Set Column Range

Do you want to display a particular range of columns within the Excel window? Here's a couple ways you can accomplish the ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 2?

2021-11-03 04:00:46

Clive

Whoops, forgot one keystroke. Alt-V (View menu), Z (for Zoom), Alt-E (to select the % box), up/down arrow (to set %), Enter (to set).


2021-11-03 03:57:59

Clive

Some of us remember the keyboard shortcuts from older versions, and they still work! Alt-V (View menu), Z (for Zoom), up/down arrow (to set %), Enter (to set).


2021-11-02 06:47:56

JD Murphy

Zooming with the touch-pad can be a pain as it can be triggered accidentally. How can I turn it off?


2021-11-02 06:01:58

Kiwerry

Thanks, very much Philip
I have just tried your hint out, and found that it worked in Excel 365 but not Excel 2010.
If/when I drop the 365 subscription I would assign Control+Alt+"+" to the zoom in macro and Control+Alt+"-" to the zoom out macro to maintain compatibility.


2021-11-02 04:24:23

Philip

I believe that since Excel 2016 a keyboard shortcut was actually introduced (Control+Alt+"+" to zoom in and Control+Alt+"-" to zoom out). This does steps of 15% zoom each time when pressed ...


2018-04-02 14:12:34

Daniel

Actually F6 will get you to the status bar and then you can arrow over to the zoom in or out. You do not need VBA for this.


2018-03-31 06:09:44

Willy Vanhaelen

Here is a one line variant of both macros:

Sub MyZoomIn()
ActiveWindow.Zoom = Application.Min(Int(ActiveWindow.Zoom * 1.1), 400)
End Sub

Sub MyZoomOut()
ActiveWindow.Zoom = Application.Max(Int(ActiveWindow.Zoom * 0.9), 10)
End Sub


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.