How to Repeat Rows While Printing in Excel- 3 Methods

Consider a dataset of 100 students’ marks in 3 subjects. To print it and display the header row on each page:

Sample Dataset to Repeat Rows in Excel when Printing

 


Method 1 – Using the Print Titles Command to Repeat Rows while Printing

Steps:

  • Go to the Page Layout tab >> Print Titles.

Access to the Page Setup Dialogue Box

  • In the Page Setup dialog box, go to the Sheet tab.
  • Enter $4:$4 in Rows to repeat at top:.
  • Click OK.

Customize Page Setup Options to Repeat Rows in Excel when Printing

The header row is repeated on every page:

Repeated Rows in Excel When Printing

Read More: How to Repeat Rows at Top in Excel


Method 2 – Rename the Rows using Print_Titles in the Name Box

Steps:

  • Click the row header number (4, here) that you want to repeat on every page. If you have multiple rows, select them all.

Click on Row Header

  • Click the Name Box and enter Print_Titles.

Rename Name Box to Repeat Rows in Excel When Printing

This is the output.

Read More: How to Repeat Rows at Top of Specific Pages in Excel


Method 3 – Applying a VBA Code to Repeat Rows While Printing in Excel

Steps:

  • Go to the Developer tab >> Visual Basic.

Access to the Visual Basic Tool

  • In the Microsoft Visual Basic for Applications window, in VBAProject, choose Sheet 4.
  • Enter the following code in the code window of Sheet4.
Sub RepeatRowsPrint()
Dim NumberOfPages As Long
NumberOfPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.PrintTitleRows = "$4:$4"
ActiveSheet.PrintOut From:=1, To:=NumberOfPages
End With
End Sub

Write Code in the VBA Window t Repeat Rows in Excel When Printing

  • Press Ctrl + S.

Save VBA Code

  • Close the VBA window and go to the File tab.

Access the File Tab

  • Choose Save As.

Choose Save As Option

  • Click Browse.

Excel Save As Window

  • Choose .xlsm in Save as type:.
  • Click Save.

Save the Excel as .xlsm Format

  • Go to the Developer tab >> Visual Basic.

Access the Visual Basic Tool

 

Run the VBA Code

  • In the Macros window, choose the macro and click Run.

Run the Macro

This is the output.

Read More: How to Make a Pattern Repeat in Excel


Download Practice Workbook

Download the practice workbook.


Related Articles


<< Go Back to Repeat in Excel | Excel Cell Format | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Tanjim Reza
Tanjim Reza

Md. Tanjim Reza Tanim, a BUET graduate in Naval Architecture & Marine Engineering, contributed over one and a half years to the ExcelDemy project. As an Excel & VBA Content Developer, he authored 100+ articles and, as Team Leader, reviewed 150+ articles. Tanim, leading research, ensures top-notch content on MS Excel features, formulas, solutions, tips, and tricks. His expertise spans Microsoft Office Suites, Automating Finance Templates, VBA, Python, and Developing Excel Applications, showcasing a multifaceted commitment to the... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo