
A worksheet that looks fine on screen can be awkward to print. The last column may spill onto a separate page, a helper column may appear in the printout, or the second page may lose the column labels. Excel’s page layout settings control which cells print and how they fit on paper.
This guide shows two ways to set page layout in Excel for printing. First, you’ll use Microsoft Excel for Windows to adjust the layout and review it in Print Preview. Then you’ll use C# and Spire.XLS for .NET to apply the same print settings to multiple workbooks in a single run.
Set Up an Excel Worksheet for Printing
If you’re preparing a single worksheet for printing, Excel’s Page Layout tab lets you adjust the settings directly. Start by choosing which cells to print, then set the paper size, orientation, margins, and scaling to suit the report. Use Print Preview to check how the worksheet is divided across pages and whether the text is still easy to read.
Set or clear the print area
- Select
A1:G17, or the range you want to print. - On the Page Layout tab, select Print Area → Set Print Area.
- Open File → Print to check that any helper columns outside the range are excluded.
To start over, choose Page Layout → Print Area → Clear Print Area. Excel saves the print area with the workbook, so it will still apply the next time you open the file.

Change paper size, orientation, and margins
On the Page Layout tab, adjust these three settings:
- Paper size — Select Size → A4 for the sample report. Before printing, check that the paper size matches the selected printer’s settings.
- Orientation — Select Orientation → Landscape to give the report more room across the page.
- Margins — Select a preset under Margins , or choose Custom Margins to set the top, bottom, left, and right margins individually.
Print an Excel sheet on one page
Open File → Print and use the scaling menu under Settings. Your choice depends on whether the report needs to fit on a single sheet of paper or simply needs to keep its columns together.
| Scaling option | Result | When to use it |
|---|---|---|
| Fit Sheet on One Page | Scales the selected print area to one page wide and one page tall | A short report that stays readable after scaling |
| Fit All Columns on One Page | Keeps all columns together and lets rows continue onto additional pages | A long report that needs readable text and a complete set of columns on each page |
The second option is equivalent to setting Width to 1 page and Height to Automatic in the Scale to Fit group on the Page Layout tab. Check the print preview after changing the scaling, especially if the report has many rows.

You May Also Like: 7 Effective Ways to Print an Excel Sheet on One Page
Repeat header rows on every printed page
- Open Page Layout → Print Titles.
- On the Sheet tab, enter
$1:$1in Rows to repeat at top. - Select OK, then check page 2 in print preview.
Use a longer version of the report to see the effect. Set the print area to include the extra rows and choose Fit All Columns on One Page so the report can continue onto later pages. The Row and column headings checkbox controls Excel’s own labels, such as A, B, C and 1, 2, 3. Print Titles controls the report’s header rows.

Preview the layout and check page breaks
- Review the print preview. Go to File → Print and check the first and last pages. Look for clipped columns, text that’s too small to read, and pages with only a few cells.
- Check where pages break. Go to View → Page Break Preview to see where Excel splits the worksheet. Check whether each report section starts on the intended page.
- Use percentage scaling for manual page breaks. Excel ignores manual page breaks when Fit to scaling is active. If you need to control where a page ends, open Page Setup → Page and select Adjust to under Scaling .
Set Excel Print Layout in C# with Spire.XLS for .NET
If you prepare a folder of monthly reports from the same template, opening each workbook to set the print area, margins, and scaling can take more time than the setup itself. It’s also easy to miss a setting in one file and end up with inconsistent printouts.
With C# and Spire.XLS for .NET, you can define the print settings once and apply them to every workbook in the folder. The examples below start with a single workbook, then show how to reuse the same settings for an entire batch.
Install the NuGet package
Create a C# console project and run the following command from the project directory.
dotnet add package Spire.XLS
Apply print settings to one workbook
Place input.xlsx in the program’s working directory. The example applies the settings to the first worksheet and saves a new workbook named PagePrintOptions.xlsx.
using Spire.Xls;
Workbook workbook = new Workbook();
workbook.LoadFromFile("input.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
PageSetup pageSetup = worksheet.PageSetup;
// Set page margins in inches.
pageSetup.TopMargin = 0.3;
pageSetup.BottomMargin = 0.3;
pageSetup.LeftMargin = 0.3;
pageSetup.RightMargin = 0.3;
// Set the print area and the report rows to repeat.
pageSetup.PrintArea = "A1:G17";
pageSetup.PrintTitleRows = "$1:$1";
// Set optional print preferences.
pageSetup.IsPrintHeadings = true;
pageSetup.IsPrintGridlines = true;
pageSetup.PrintComments = PrintCommentType.InPlace;
pageSetup.PrintQuality = 300;
pageSetup.BlackAndWhite = true;
pageSetup.Order = OrderType.OverThenDown;
// Fit the print area on one page.
pageSetup.FitToPagesWide = 1;
pageSetup.FitToPagesTall = 1;
workbook.SaveToFile("PagePrintOptions.xlsx", ExcelVersion.Version2016);
workbook.Dispose();
The code sets 0.3-inch margins on all four sides and keeps the workbook’s existing paper size and orientation. For the same A4 landscape layout as the manual example, start with a workbook template that already uses those two settings.
The optional settings include gridlines, Excel’s row and column labels, black-and-white output, and a requested print resolution of 300 dpi. The actual resolution depends on the printer. PrintCommentType.InPlace corresponds to printing legacy notes where they are displayed on the sheet. OverThenDown sets the order for layouts that span multiple pages across and down.
To fit all columns across one page and let the rows continue vertically, replace the two scaling assignments with the following. For longer reports, also extend PrintArea to include the additional rows.
pageSetup.FitToPagesWide = 1;
pageSetup.FitToPagesTall = 0;
Here is the print preview of the workbook saved by the code:

Apply the same settings to multiple workbooks
Put the source .xlsx files in an input folder. This example applies the same print settings to the first worksheet in each workbook and saves a copy in output using the original filename.
A print area is useful when you want to print only part of a worksheet. In a batch, reports often contain different numbers of rows, so leave PrintArea unset when you want to print all worksheet data. Set a fixed range such as A1:G17 only when every workbook should print that exact range. If a source worksheet already has a saved print area, the code below preserves it. Clear that area in the source workbook if you want Excel to print all its data.
using System;
using System.IO;
using Spire.Xls;
const string inputFolder = "input";
const string outputFolder = "output";
const int pagesTall = 1; // Set to 0 for automatic height.
Directory.CreateDirectory(outputFolder);
foreach (string inputPath in Directory.EnumerateFiles(inputFolder, "*.xlsx"))
{
string fileName = Path.GetFileName(inputPath);
// Skip temporary lock files created by Excel.
if (fileName.StartsWith("~$", StringComparison.Ordinal))
continue;
using Workbook workbook = new Workbook();
workbook.LoadFromFile(inputPath);
PageSetup pageSetup = workbook.Worksheets[0].PageSetup;
pageSetup.PrintTitleRows = "$1:$1";
pageSetup.TopMargin = 0.3;
pageSetup.BottomMargin = 0.3;
pageSetup.LeftMargin = 0.3;
pageSetup.RightMargin = 0.3;
pageSetup.IsPrintHeadings = true;
pageSetup.IsPrintGridlines = true;
pageSetup.PrintComments = PrintCommentType.InPlace;
pageSetup.PrintQuality = 300;
pageSetup.BlackAndWhite = true;
pageSetup.Order = OrderType.OverThenDown;
pageSetup.FitToPagesWide = 1;
pageSetup.FitToPagesTall = pagesTall;
string outputPath = Path.Combine(outputFolder, fileName);
workbook.SaveToFile(outputPath, ExcelVersion.Version2016);
Console.WriteLine($"Saved {outputPath}");
}
Open an output workbook and choose File → Print . Confirm that all intended data appears in the preview and that the text is readable. If a longer report looks too small on one page, set pagesTall to 0 to keep all columns on one page wide while allowing rows to continue onto later pages. If the preview shows a second page, check that the header row repeats there.
You May Also Like: How to Print Excel Files in C#
Frequently Asked Questions
Q1. Why is my Excel sheet so small when I print it on one page?
Excel reduces the scale to fit both the width and height of the print area. For a report with many rows, choose Fit All Columns on One Page so the extra rows can flow onto later pages.
Q2. Why does Excel print extra blank pages?
Start by checking the print area. Clear an outdated area and select only the report cells. If the preview still shows extra pages, inspect the sheet in Page Break Preview to see where Excel is dividing the range.
Q3. Can I use different print settings for each worksheet?
Yes. In Excel, select each worksheet and configure its page setup. In C#, access each sheet’s PageSetup and assign the appropriate print area and scaling for that sheet.
Q4. Can I save the print layout without printing the workbook?
Yes. Save the workbook after configuring the page layout in Excel. The C# examples save the configured workbooks as .xlsx files for later preview and printing.
Conclusion
When you set page layout in Excel for printing, start by defining what should appear on the page. Set the print area to include only the relevant data, then adjust the paper size, orientation, and margins. In Print Preview, check whether the report is still readable at the selected scale. A short worksheet may fit comfortably on one page. For a longer report, fit all columns across one page and repeat the header rows so readers can follow the data on later pages.
For occasional reports, Microsoft Excel gives you direct control over these settings and lets you check the result before printing. If you prepare a folder of workbooks based on the same template each month, C# and Spire.XLS for .NET let you apply the same print settings in one run. Open a saved workbook in Print Preview to confirm that the print area, scaling, and repeated headers work as expected before printing the batch.