[Solved]: Page Break in Excel Not Working Error

We have three different data tables, each containing the names, IDs, and joining dates of employees of three different companies. We’ll solve the most common problems with page breaks.

Suitable Solutions for the Page Break in Excel Not Working Error

Solution 1 – Using Page Setup Group

Steps:

  • Insert page breaks in the worksheet.
  • Select row 9.
  • Go to the Page Layout tab of the ribbon.
  • In the Page Setup group, choose the Insert Page Break command from the Breaks drop-down menu.

Suitable Solutions for the Page Break in Excel Not Working Error

  • Follow the same process to insert the page break in row 17.

Suitable Solutions for the Page Break in Excel Not Working Error

  • There are no page breaks in those rows.

Suitable Solutions for the Page Break in Excel Not Working Error

  • Go to the Page Layout tab of the ribbon again.
  • Click on the little arrow on the lower right side of the Page Setup group.

Suitable Solutions for the Page Break in Excel Not Working Error

  • You will see a dialog box named “Page Setup.
  • In the Page tab of the dialog box, choose the option Adjust to if it was not marked previously.
  • Press OK.

Suitable Solutions for the Page Break in Excel Not Working Error

  • You will see the page breaks in the worksheet.

Suitable Solutions for the Page Break in Excel Not Working Error

Read More: How to Remove Automatic Page Break in Excel


Solution 2 – Applying VBA Code to Fix Page Break Issue

Steps:

  • Insert page breaks in rows 10 and 17.

Suitable Solutions for the Page Break in Excel Not Working Error

  • You will not notice any page breaks on the worksheet after applying the Insert Page Break command.

Suitable Solutions for the Page Break in Excel Not Working Error

  • Go to the Developer tab of the ribbon and choose the Visual Basic command from the Code group.

Sample Data Set

  • You will see a new tab.
  • Choose the Module command from the Insert tab.

Sample Data Set

  • Insert the following code into the module.
Sub Page_Break_Not_Working()
'Communication with the printer is turned off
Application.PrintCommunication = False
'Set the print area to cell B2:D23 on sheet VBA
ActiveSheet.PageSetup.PrintArea = "$B$2:$D$23"
'Switch the display in VBA sheet to page break preview
ActiveWindow.View = xlPageBreakPreview
ActiveWindow.View = xlNormalView
End Sub

Sample Data Set

VBA Code Breakdown

  • We will name the function in the VBA as Page_Break_Not_Working.
  • We will declare the communication of the worksheet with printer is turned on or off.
  • We will set the worksheet area or cell range within which the page break will be applied by using the command line .ActiveSheet.PageSetup.PrintArea = “$B$2:$D$23”
  • We will write the xlPageBreakPreview command to show the page break in the worksheet.
  • Save the code and press the play button or F5 for the solution.

Sample Data Set

  • You will see page breaks in the worksheet after running the code.

Sample Data Set

Read More: How to Insert Page Break Based on Cell Value with Excel VBA


Download the Practice Workbook


Related Articles


<< Go Back to Page Setup | Print in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Md. Araf Bin Jayed
Md. Araf Bin Jayed

I am Araf. I have completed my B.Sc in Industrial and Production Engineering from Ahsanullah University of Science and Technology. Currently I am working as an Excel & VBA Content Developer in Softeko. With proper guideline and aid of Softeko I want to be a flexible data analyst. With my acquired knowledge and hard work, I want to contribute to the overall growth of this organization.

2 Comments
  1. Extra, thanks for helping me –

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo