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

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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