Fixed Page Break

nhinx

New Member
Joined
Aug 25, 2016
Messages
40
Office Version
  1. 2010
Dear Excel Experts,

I'm trying to establish a uniform document so that which ever computer or printer they use, the output is still the same. I want the page break of first page be in row 61 while succeeding pages will be in every 56 rows. Also, when someone removed or reset the page break it should go back to the settings that I want. For example if the page break is already in row 61 and I added some rows, it should go back to row 61 and every 56 rows of succeeding pages when I switch to other sheets. Kindly help me generate a VBA code for this?

Thank you very much,

Nhinx
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
You can reset and reprogram page breaks via VBA with this:

Code:
    'reset pagebreaks
ActiveSheet.ResetAllPageBreaks
    'add new page break (new page starting at what range)
ActiveSheet.HPageBreaks.Add Range("A62")
 
Upvote 0
Hi CalcSux,

Thank you for your code. However, after running the code I have now 2 Page Breaks. The one is the solid blue line which was assigned by the code in row 62 and the other one is the automatic Page break which is the blue broken line in row 60.

Nhinx
 
Upvote 0
If your Page Break exceeds the available space on the current page, excel will automatically insert a "soft break." If you're requiring the first break to be at line 62, you'll need to look into adjusting margins or row heights.
 
Upvote 0
Yeah right, but it needs to be fixed since my template format should be same if I will disseminate it to my colleagues.

Thanks,

Nhinx
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,823
Members
449,049
Latest member
cybersurfer5000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top