30 Advanced Excel Tips for 2026

Excel Champs / Excel Basics / How to Change Page Margin in Excel
By Puneet Gogia (Microsoft MVP)

How to Change Page Margin in Excel

30+ Advanced Excel Tips for 2026

No spam. Only Excel Stuff. God Promise. 😊

Go to Page Layout → Margins and pick Normal, Wide or Narrow. For your own values, click Custom Margins at the bottom of the list (or press Alt → P → M → A), type the top, bottom, left and right margins on the Margins tab of Page Setup and click OK.

The default Normal setting is 1.91 cm (0.75 in) top and bottom, 1.78 cm (0.7 in) left and right, and 0.76 cm (0.3 in) for the header and footer. The Header and Footer boxes on the same tab set how far those sit from the page edge, so keep them smaller than the top and bottom margins or they print over your data.

To adjust margins by eye, press Ctrl + P, click Show Margins at the bottom right of the preview and drag the lines. The margins drop-down under Settings on the same screen offers the presets too.

Margins are saved per sheet, not per workbook. To change several sheets at once, hold Ctrl or Shift and click their tabs first, set the margins, then right-click a tab and choose Ungroup Sheets so your next edits don’t land on every sheet.

If columns still spill onto a second page, smaller margins won’t fix it on their own. Set Page Layout → Scale to Fit → Width to 1 page, and tick Horizontally under Center on page in Page Setup to centre a narrow table.

When you change the margins, you can fit more data on each page, reducing the number of pages needed. This can save paper and make the workbook easier to read. If you want to print a paper report, you have the option to change the page margins according to your need.

page-margin-in-excel

You can change these margins as per your requirement. In this tutorial, we will look at all the different options and methods that you have in Excel to change the page margins.

Default Margins in Excel

By default (the Normal preset), the margins are 1.78 cm (0.7 inch) for the left and right, 1.91 cm (0.75 inch) for the top and bottom, and 0.76 cm (0.3 inch) for the header and footer. These settings work well for most standard printing needs. Note that the data starts at the top-left margin; it isn’t centered on the page unless you turn on centering.

Steps to Change Page Margin in Excel

In Excel, changing margins doesn’t require you to follow any complex steps. There’s an option available on the ribbon that you can use to enter the values you want to set.

change-page-margin
  1. Click on the “Page Layout” tab on the ribbon. In the Page Layout tab, click the “Margins” button in the Page Setup group.
  2. You can select from predefined options like Normal, Wide, or Narrow. To create a custom margin, click “Custom Margins” at the bottom of the drop-down.
  3. In the Page Setup dialog box, enter your margins for the top, bottom, left, and right. Click “OK” to apply the changes.
  4. In the end, make sure to go to “File” > “Print” or use the print preview keyboard shortcut to see how your new margins look in the print preview.

There are three major pre-defined settings you can use: Normal (Default), Wide, and Narrow.

Understanding Custom Page Margins in Excel

As I said, you can also use custom page margin values. Open the Margins drop-down on the Page Layout tab and click the “Custom Margins” option to open the dialog box. You can also use the keyboard shortcut, Alt ⇢ P ⇢ M ⇢ A.

custom-page-margins

In the dialog box, you can change the page margin values and set a new one.

page-setup-dialog-box

You can also change the values for the header and footer and put the content at the center vertically and horizontally.

Adjust Margins from Print Preview Window

When you open the print preview, you also have the option to change the margins there. In the Settings section, scroll down to the bottom and click on the margins drop-down.

adjust-margins

When you click on it, you get the predefined settings, the Custom Margins option, and the Last Custom Setting that you used.

pre-defined-margins

This is the same list of options that you have in the page layout tab on the ribbon.

Show Margins and Change them with Mouse

You can also use the “Show Margins” option in the print preview to change the margins with your mouse cursor. At the bottom right of the print preview window, there’s a tiny button; click it to turn it on.

show-margins -Copy

The moment you click on it, it shows all the margins on the page as lines, and you can drag them with the mouse cursor.

preview-margins-on-the-page

When you have multiple worksheets in your workbook, and you want to use a custom margin value for all of them, you need to change it for each sheet (or select the sheets together, as shown below).

VBA Code to Change Margin for All the Worksheets

When you change margins, the changes apply only to the worksheet you are working on, not to the other sheets or workbooks.

Each worksheet has its own margin settings. If you want the same margin settings for multiple worksheets, you can use the following code instead of adjusting them one by one.

Sub SetUniformMargins()
    Dim ws As Worksheet
    Dim topMargin As Double
    Dim bottomMargin As Double
    Dim leftMargin As Double
    Dim rightMargin As Double
    Dim headerMargin As Double
    Dim footerMargin As Double
    
    ' Define your margin sizes in points (1 inch = 72 points)
    topMargin = Application.InchesToPoints(1)       ' 1 inch
    bottomMargin = Application.InchesToPoints(1)    ' 1 inch
    leftMargin = Application.InchesToPoints(0.75)   ' 0.75 inch
    rightMargin = Application.InchesToPoints(0.75)  ' 0.75 inch
    headerMargin = Application.InchesToPoints(0.5)  ' 0.5 inch
    footerMargin = Application.InchesToPoints(0.5)  ' 0.5 inch

    ' Loop through each worksheet in the workbook
    For Each ws In ThisWorkbook.Worksheets
        With ws.PageSetup
            .topMargin = topMargin
            .bottomMargin = bottomMargin
            .leftMargin = leftMargin
            .rightMargin = rightMargin
            .headerMargin = headerMargin
            .footerMargin = footerMargin
        End With
    Next ws
    
    MsgBox "Now all the wokrsheets have same margin setting."
End Sub

The above code will change the top, bottom, left, right, header, and footer margins for all worksheets in the workbook that has the code (ThisWorkbook). You can adjust the margin values as needed by changing the values assigned to topMargin, bottomMargin, leftMargin, rightMargin, headerMargin, and footerMargin.

To run this code, press Alt + F11 to open the VBA editor, insert a new module, and paste the code into the module. Then run the SetUniformMargins macro.

Important Points to Consider

  • Check the print preview after changing margins to make sure everything looks good.
  • Adjust header and footer margins separately, especially if you have important information.
  • Margins might need adjustment if you change the page orientation (portrait or landscape).
  • Combine the margin change with the “Fit to Page” option for the best print layout.

Change Margins for Several Sheets Without VBA

Select all the sheets first (click the first sheet tab, hold Ctrl and click the others, or right-click a tab ➜ Select All Sheets), then set the margins. They apply to every selected sheet. In the end, right-click a sheet tab and click Ungroup Sheets, so your next edits don’t go to all the sheets.

Frequently Asked Questions

What units does Excel use for margins?

The Page Setup dialog box shows margins in inches or centimeters, based on the regional settings of your computer. In VBA, margins are in points, so use Application.InchesToPoints or Application.CentimetersToPoints.

Why can’t I set the margin to zero?

Most printers can’t print right up to the edge of the paper. Excel lets you type 0, but the printer still leaves its own unprintable border, and some printers show a warning.

Do margins change how my data looks on the screen?

No. Margins only affect printing. You can see them in the print preview and in Page Layout view (View ➜ Page Layout).

Puneet Gogia

Written by

Puneet Gogia

Microsoft MVP — Excel · Founder, Excel Champs

Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.

3M+ readers helped
1,000+ tutorials written
Since 2015 teaching Excel