Skip to main content

How to insert page break every x rows in Excel?

Author Sun Last modified

When preparing large Excel worksheets for printing, you might find it necessary to insert page breaks at regular intervals—such as after every few rows—to improve readability and ensure each printed page contains consistent, well-organized data. While adding a single page break is straightforward in Excel, inserting breaks at repeating intervals (for example, every3 or10 rows) can quickly become a tedious task if done manually, especially for extensive datasets. In this article, you will learn several practical solutions for automatically inserting page breaks after every x rows, allowing for more professional and manageable printouts.


Insert page break every X rows with VBA in Excel

If you need to insert page breaks after a specific number of rows in Excel, VBA provides an efficient automated solution, especially for large datasets. Even if you are new to working with macros, you can follow the process below. This example demonstrates how to insert a page break every 3 rows, but you can specify any interval you need during execution.

1. Press Alt + F11 to open the Microsoft Visual Basic for Applications (VBA) editor—this is Excel’s built-in tool for writing and running macro code.

2. In the VBA editor that appears, click Insert > Module to create a new module. Then copy and paste the following VBA code into the newly created module window.

VBA: Insert page break in every X rows in a worksheet.

Sub InsertPageBreaks()
'Updateby20140618
Dim xLastrow As Long
Dim xWs As Worksheet
Set xWs = Application.ActiveSheet
xRow = Application.InputBox("Row", xTitleId, "", Type:=1)
xWs.ResetAllPageBreaks
xLastrow = xWs.Range("A1").SpecialCells(xlCellTypeLastCell).Row
For i = xRow + 1 To xLastrow Step xRow
    xWs.HPageBreaks.Add Before:=xWs.Cells(i, 1)
Next
End Sub

3. To run the code, click the Run button (or press F5). You will see a dialog box prompting you to enter the number of rows after which you want to insert page breaks. For example, entering "3" will add a page break after every third row.
A screenshot showing the VBA dialog box to specify the row interval for page breaks with Excel

4. After you click OK, the script will automatically place a page break after every specified interval of rows, throughout your active worksheet.

When using VBA for page breaks, make sure to check your worksheet for any pre-existing manual page breaks, as repeated script runs can create overlapping page breaks and produce unexpected print results. If you need to remove all breaks before rerunning the macro, use the Reset All Page Breaks option under the Page Layout tab beforehand. Remember to save your file before running VBA scripts, as macros can’t be undone using the regular Undo function.

This approach is best for users comfortable with basic editing in Excel and those dealing with evolving or large data ranges. However, if frequent adjustments or non-standard ranges are required, consider using more flexible or GUI-assisted solutions, such as the ones below.


Batch insert page breaks after every x rows with Kutools for Excel

If you have Kutools for Excel installed, you can significantly simplify batch insertion of page breaks. The Split to Columns utility in Kutools enables you to insert page breaks at regular intervals and keep the row headings visible at the top of each new page. This is especially useful for reports or tables where repeated headings boost clarity and professionalism, and where print layout consistency is a priority.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

1. Click Split to Columns from the Kutools Plus tab to access the utility.

2. In the Split to Columns dialog box, configure the following settings for precise control:
A screenshot of the Split to Columns dialog box
(1) Use the A screenshot showing the Browse button button in the Titles range box to select the row containing your column headings. This ensures headers will repeat on each printed page.
(2) Click the A screenshot showing the Browse button button in the Date range box to select the main data range you wish to split.
(3) In the Rows per printed page box, enter the number of rows you want on each printed page (e.g., enter3 for a break every 3 rows; use 1 for a break after every row).
(4) Enter 1 in the Number of segments box to split the sheet accordingly.

3. Click Ok to process the data.

The utility will output your selected range to a new worksheet, automatically inserting page breaks as specified and repeating the header row. For verification, switch to the Page Break Preview mode by going to the View tab and selecting Page Break Preview—here, blue lines will clearly show page breaks. 

A screenshot of a worksheet showing page breaks after every X rows

This method is suitable for users needing repeated headings and precise control over dataset segmentation for printing. Note that the original data is not altered; results appear in a new worksheet, which is helpful for preserving the source.

Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now


Insert page breaks after every x rows with Kutools for Excel

Kutools for Excel also offers a dedicated Insert Page Break Every Row utility, allowing you to insert page breaks after every specified number of rows quickly and easily within your selected range. This tool is convenient for both quick batch operations and situations that require flexible intervals without repetitive manual input. Particularly, it is helpful for data tables that don’t require repeated headings but do need uniform page partitioning before printing.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

1. Select the data range for which you wish to insert page breaks, then navigate to Kutools Plus > Printing > Insert Page Break Every Row.

2. In the pop-up Insert Page Break Every Row dialog, enter your desired interval—for example, entering “1” will add a page break after every other row. Click Ok.
A screenshot of the 'Insert Page Break Every Row' dialog box

As soon as you confirm, all page breaks will be set according to your specified row interval. Refresh the view with Page Break Preview (from the View tab) if you want to visually confirm the breaks.

Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now


Manually insert page breaks using Page Break Preview

For users working with smaller datasets or requiring custom, non-uniform intervals for page breaks, Excel’s built-in Page Break Preview view allows direct manual control. This approach is ideal for cases in which automated solutions are unnecessary or offer too little flexibility.

1. Switch to View > Page Break Preview from the ribbon. This displays your worksheet with bold blue lines that represent existing page breaks.

2. To add a break, select the first cell of the row below where you want the new page to begin, then go to the Page Layout tab, click Breaks > Insert Page Break.

3. Repeat the process for each desired break. If you need to adjust a page break, simply drag the blue line to a new position.

This manual method is straightforward for small or infrequent tasks but not recommended for large volumes of pages, as it quickly becomes time-consuming. If many regular breaks are needed, automated VBA or Kutools solutions are much more efficient.


When inserting page breaks in Excel, consider the following tips and error reminders: Always preview your worksheet using the Page Break Preview mode to ensure page breaks appear exactly as desired before printing. If you encounter errors such as unexpected blank pages or misaligned breaks, double-check your selected range, ensure no overlapping page breaks exist, and remove any unnecessary manual breaks if needed. Remember, Excel has a maximum number of page breaks per worksheet—if your range is very large, you may need to adjust your approach or split printing tasks. If you need to undo inserted breaks, you can use the Reset All Page Breaks option under the Page Layout tab.

In summary, whether you’re working with a small table that requires precise manual tweaks or a large dataset where automation and repeated formatting are needed, Excel offers methods ranging from built-in manual controls, VBA automation, to friendly GUI solutions like those found in Kutools for Excel, each suitable for different printing and reporting scenarios.


Demo: insert page break every x rows in Excel

 
Kutools for Excel: Over 300 handy tools at your fingertips! Enjoy permanently free AI features! Download Now!

Related Articles:

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!