Would View>Page break review be any good for you?
It allows you to adjust the page breaks manually.
Regards,
Curt
Main Topics
Browse All TopicsIs there a way to keep some contiguous rows together while printing in Excel? We want to keep the rows in such a way that either all of those print to current page or all of those print to next page i.e. the page break should not separate those rows. We already have overall PrintArea setup to fit the columns in one page width and let Excel decide the page breaks.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
If it were so easy I would not be asking this here :) I am not a novice and I have also done a through "Googling". When I could not find anything satisfactorily, I have posted it here.
The groups are not static. In fact the report itself is not static, it is generated dynamically and numbers of rows within the group vary. Currently we are doing it a very hard way by counting the number of rows, then deciding if the page break should be put after a group based on how many groups can be fit in a page. That is very cumbersome and error prone and is to be done per report/per group. What I am looking for is to be able to mark some rows as a group in Excel so that it doesn't break it. If there is a way in Excel, we can use Excel automation to do that "marking" from the report generation engine and then we don't have to count the rows in each page per report.
Amit,
You would think that Excel would make what you are trying to do easy--but it most certainly does not.
In my day job, I produce a routine document that contains a mix of rows with and without vertically merged cells. When Excel determines where the page breaks lie, it looks pretty dumb to have a vertically merged cell print partially on one page and the rest on another. It also looks dumb if an automatic page break puts a section header at the bottom of one page, with the content beginning on the next. I therefore wrote a routine to insert page breaks where they would look better. This routine is called by a Workbook_BeforePrint event sub.
I am posting the code below as an example only. It was written with the peculiarities of one specific workbook and its formatting in mind, and very likely needs modification to suit your circumstances.
Brad
Amit,
Thanks for the kind words and grade! It's people like you who make this site worthwhile for the experts.
Assuming that you want to use my code as a starting point, but have problems with implementation, please continue posting in this thread. Doing so will make it more valuable in the Experts-Exchange database.
Brad
Business Accounts
Answer for Membership
by: rlistenbPosted on 2008-01-23 at 15:07:20ID: 20728904
Why not just use the page break view and set the breaks where you want them??
Goto VIEW -> PAGE BREAK PREVIEW