How to Keep Header in Excel When Printing (3 Ways)

 

For this tutorial, we’ll use a table that has 50 rows which aren’t possible to print on one page.

Upon printing, on the second page, it will look something like this.

As you can see there is no header on the second page. We’ll show how you can fix that.


Method 1 – Using Page Setup to Keep the Header When Printing

Steps:

  • Go to the Page Layout tab.
  • Under the Page Setup group, click on Print Titles.

Keeping Header in Excel When Printing from page layout

  • In the Page Setup box, go to the Sheet tab.
  • Select Rows to repeat at top of the Print Titles.
  • Select row 4 from the spreadsheet or type $4:$4 in the box.

page setup box to keep header in excel when printing

  • Cick on OK.
  • Go to File, then click on Print (or press Ctrl + P) to print the spreadsheet and it will have headers in the later pages.

pdf view to keep header in excel when printing

Read More: How to Add Header in Excel


Method 2 – Applying VBA Macro to Keep Header in Excel

Steps:

  • Go to the Developer tab.
  • Select Visual Basic from the Code group.

  • In the VBA window, go to Insert and select Module.

  • Select the module from the Modules folder and insert the following code.
Sub Repeat_Header_Every_Page()

Dim TotalPages As Long

TotalPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")

With ActiveSheet.PageSetup
.PrintTitleRows = "$4:$4"

ActiveSheet.PrintOut From:=1, To:=TotalPages
.PrintTitleRows = ""

End With
End Sub
  • Save it and close the window.
  • Go back to the Developer tab and select Macros.

  • In the Macro box, select the macro with the name you have just created and click on Run.

selecting macro to keep header in excel when printing

  • Save the pages as a PDF document, which will contain a header in the later pages. You can then print the PDF.

preview of the print file

Read More: How to Add Same Header to All Sheets in Excel


Method 3 – Using Sheet Options to Keep the Row and Column Headers When Printing

Steps:

  • Go to the Page Layout tab.
  • Go to the Sheet Options group and, under Headings, check the box for Print.

enabling print headings option

  • Go to File, then click on Print (or press Ctrl + P). You can see the row and column headings in the preview print and your printed page will have them, too.

headings on the excel spreadsheet

Read More: How to Remove a Header in Excel


Download the Practice Workbook


Related Articles


<< Go Back to Header and Footer  | Page Setup in Excel | Print in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Abrar-ur-Rahman Niloy
Abrar-ur-Rahman Niloy

Abrar-ur-Rahman Niloy, holding a B.Sc. in Naval Architecture and Marine Engineering, has contributed to Exceldemy for nearly 1.5 years. As a leader in Excel, VBA, and Content Development teams, he authored 114+ articles and assisted the Exceldemy forum. Presently, as a project writer, he prioritizes stepping out of his comfort zone, aiming for constant technical improvement. Niloy's interests encompass Excel & VBA, Pivot Table, Power Query, Python, Data Analysis, and Machine Learning libraries, showcasing his commitment to diverse... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo