How to Center a Worksheet Horizontally and Vertically in Excel

To center a worksheet on the printed page in Excel, go to Page Layout > Margins > Custom Margins. Under Center on page, check Horizontally, Vertically, or both, then select OK. Your data prints in the middle of the page instead of the top-left corner.

These steps follow Microsoft’s Set page margins before printing a worksheet article. They apply to the Excel desktop app for Windows in Excel for Microsoft 365, and the same dialog box is in Excel 2024, 2021, 2019, 2016, 2013 and 2010. Mac steps are further down. The setting only affects the printout or a PDF you create from the sheet. Nothing moves on screen, and your cells and formulas stay where they are.

How to Center a Worksheet Horizontally and Vertically

You need the Excel desktop app and a workbook with some data in it. Then follow these steps.

  1. Click the tab of the sheet you want to print. It is at the bottom of the Excel window.
  2. Select the Page Layout tab on the ribbon, the strip of tabs and buttons at the top of the window.
  3. In the Page Setup group, select Margins. A menu opens with Normal, Wide and Narrow presets.
  4. Select Custom Margins at the bottom of that menu. The Page Setup dialog box opens on its Margins tab.
  5. Under Center on page, check Horizontally and Vertically. The small preview in the dialog box shows the new position.
  6. Select OK.
Excel Page Setup Margins tab with Horizontally and Vertically checked under Center on page
Check Horizontally and Vertically under Center on page, then choose OK. The preview shows the example grid centered both ways.

Your data sits in the middle of the printed page. The worksheet looks the same on screen in Normal view.

You can reach the same dialog box another way. Microsoft’s Page Setup article says to click the Page Layout tab, then the Dialog Box Launcher in the Page Setup group. That is the small arrow in the corner of the group. Then select the Margins tab yourself.

If a sheet is stuck in Page Layout or Page Break Preview, you can switch it back to Normal view.

Center the Sheet From the Print Screen

If you are already looking at the print preview, you don’t have to leave it.

  1. Select File > Print, or press Ctrl+P. Microsoft also lists Ctrl+F2 for the print preview.
  2. Under Settings, open the margins menu. It usually reads Normal Margins.
  3. Select Custom Margins. The Page Setup dialog box opens on the Margins tab.
Excel File Print margins menu detail with Custom Margins highlighted below Normal, Wide and Narrow presets
Print settings detail. Open Normal Margins, then choose Custom Margins to reach the Center on page boxes. (Recreated interface)
  1. Check Horizontally and Vertically under Center on page, then select OK.

The preview on the right updates right away. In most versions there is also a Page Setup link at the bottom of the Settings list that opens the same dialog box.

Horizontally vs. Vertically: Which Box to Check

The two check boxes work independently, so you can use one or both.

  • Horizontally centers the data from left to right. Use it alone for a narrow table that should still start at the top of the page.
  • Vertically centers the data from top to bottom. Use it alone for a short list that should stay against the left margin.
  • Both puts the data in the middle of the page. This suits a small table, a sign or a one-page handout.
Comparison of the Horizontally and Vertically check boxes under Center on page in Excel
Illustration: what the Horizontally and Vertically check boxes do.

Microsoft describes this option as centering the data on the page within the margins. A margin is the blank space between your data and the edge of the paper. So Excel centers the data in the space left over after the margins, not on the sheet of paper itself. That matters in the troubleshooting section below.

On a multipage printout, centering applies to every page of that sheet. A short last page gets centered too, which can look odd. Fixing the page breaks or scaling first (see below) usually gives a cleaner result.

Check the Result and Undo It

Go to File > Print, or press Ctrl+P, and look at the preview on the right. You can also select Show Margins in the lower-right corner of the preview and drag the margin handles to fine-tune the layout.

To measure the margins on screen instead, show the ruler in Excel by switching to Page Layout view.

To undo the change, open Page Layout > Margins > Custom Margins again, clear the Horizontally and Vertically boxes, and select OK. The data goes back to the top-left corner of the printed page.

Center Several Sheets at Once

Centering is a per-sheet setting. Checking the boxes on one sheet does nothing to the others. To set several sheets in one pass, group them first.

  1. Click the first sheet tab, then hold Ctrl and click the others. For a run of neighboring sheets, hold Shift and click the last one. Or right-click a tab and choose Select All Sheets.
  2. Follow the centering steps above. They apply to every selected sheet.
  3. Click any unselected sheet to ungroup. If every sheet is selected, right-click a tab and select Ungroup Sheets.

Warning: [Group] appears in the title bar while several sheets are selected. Anything you type or delete while sheets are grouped changes all of them, so ungroup before you go back to editing.

Center Only Part of a Sheet

Excel centers whatever it is going to print. If you only want one table from a larger sheet in the middle of the page, tell Excel to print just that range. There are two ways.

  • Set a print area. A print area is a range of cells you mark as the only part to print. Select the cells, then go to Page Layout > Print Area > Set Print Area. The print area is saved with the workbook. To remove it later, choose Print Area > Clear Print Area.
  • Print a selection once. Select the cells, go to File > Print, select the arrow next to Print Active Sheets under Settings, and choose Print Selection. Nothing is saved for next time.

The centering boxes work with either one. Microsoft covers both in its Set or clear a print area on a worksheet article. Select the cells before you open the print screen, and Print Selection is ready to pick.

Center a Worksheet in Excel for Mac

The path is the same on a Mac. Microsoft’s shorter Set page margins article gives these steps:

  1. Select the sheet.
  2. Select Page Layout > Margins > Custom Margins.
  3. In the Page Setup dialog box, under Center on page, select Horizontally and Vertically.

Menu names can differ a little between Mac versions. If your ribbon tab is labeled differently, look for the Margins button and its Custom Margins option. Press Command+P to check the preview.

If the Printout Still Looks Off-Center

  • The margins are uneven. Excel centers within the margins. If the left margin is 2 inches and the right is 0.5 inch, the data sits to the right of the paper’s true middle. In Custom Margins, make Left match Right, and Top match Bottom.
  • Excel is printing more than you think. A stray value or a formatted cell far from your table can become part of the printout, which pushes the table to one side. Set a print area around the real data, as described above.
  • An old print area is in the way. When a sheet has a defined print area, Excel prints only that area. Clear it, or choose Ignore print area in the Print Active Sheets menu.
  • A page break cuts the table. Select View > Page Break Preview. Dashed lines are automatic breaks, and solid lines are ones you added. Drag a break so each page holds the part of the table you want, then check the preview again.
  • Scaling changed the layout. Scaling options such as Fit to shrink the data, and then Excel centers the smaller result. Set the scaling first, then check the centering boxes, and look at the preview after each change.
  • The preview is centered but the paper is not. Printers have their own minimum margins, and some drivers shift the page. Save the sheet as a PDF with File > Export > Create PDF/XPS Document and look at it. If the PDF is centered, the setting is right and the printer’s own page settings or driver need attention.
  • The data fills the page. Centering has no visible effect when the data already reaches every margin. Nothing is wrong.
  • Only one sheet is centered. The setting is per sheet. Group the sheets and repeat the steps.
  • A header or footer overlaps the data. Keep the Header and Footer distances smaller than the top and bottom margins.

Other Print Layout Fixes

  • Too wide for the page: select Page Layout > Orientation > Landscape. Microsoft’s orientation article notes this option is dimmed if no printer is set up or you are editing a cell. The centering boxes stay checked when you switch.
  • Spills onto a second page: open the Page Setup dialog box, choose the Page tab, select Fit to, and set it to 1 page wide by 1 tall. There are more ways to fit a spreadsheet on one page as well.
  • Margins too big or small: choose Normal, Wide or Narrow from Page Layout > Margins, or enter your own under Custom Margins.
Other print layout fixes in Excel
Illustration: other print layout fixes in Excel.

Excel Page Centering Questions

Can I center a worksheet in Excel for the web?

Excel for the web doesn’t support setting page margins, though it offers some other Page Setup options on the Page Layout tab. Open the workbook in the Excel desktop app to center a sheet on the page.

Will this setting stay with my file?

Yes. Margin settings are stored with each worksheet when you save the workbook. You can’t change the default margins for new workbooks, so set them on each sheet you print.

Is this the same as centering text in a cell?

No. Center on page moves the whole block of data on the printed page. To center text inside its cell, select the cells and use Center and Middle Align in the Alignment group on the Home tab. That changes how the sheet looks on screen too. For a title across several columns, merge the cells in Excel instead.

Does centering change my margins?

No. Your Top, Bottom, Left and Right values stay as you set them. Excel places the data in the middle of the space inside those margins.

Can a macro center a sheet?

Yes. Excel’s VBA macro language has two page setup properties for this, CenterHorizontally and CenterVertically. Microsoft’s developer reference gives this example line: Worksheets("Sheet1").PageSetup.CenterHorizontally = True. Most people only need the check boxes.

Related Guides

Once the sheet is centered, check the print preview one more time before you print. These guides cover other common print settings.