Automated page breaks created when deleting rows - affecting manual page breaks

madmorty

New Member
Joined
Dec 9, 2013
Messages
1
Hi,

I am having an issue with an Excel tool we are using to produce reports. The report is a series of pages in an Excel worksheet. The users asked me to add in the ability to choose which pages are printed off, so I wrote a macro that would copy everything to a new sheet, delete superfluous rows based on users selecting 'include' or 'exclude' next to a list of all the pages in the sheet (I have formulae associating each page to the corresponding rows), then pdf the result.

Although this normally works, I am having two problems that occur sometimes after the sheets have been deleted (depending on the pages selected to be deleted):
1) Excel adds in automated page breaks just below my manual ones. This means I often get pages that are simply a heading and two rows, then the actual content is on the next page.
2) Not all the pages are included in the report - the last few pages are often missed out.

The print area does cover all the pages.

Does anyone have any idea how I can delete rows and still keep my manual page breaks without Excel adding in automated page breaks too? I have been trying for ages and can't solve it or find anything on the Internet.

The solution MUST be something that is automated - the users are not expected to copy / paste / delete / add / pdf anything themselves.

Thanks
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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