Adjust page breaks according to table

YasserKhalil
PlatinumLounger
Posts: 4911
Joined: 31 Aug 2016, 09:02

Re: Adjust page breaks according to table

Post by YasserKhalil »

That's amazing my tutor. Thank you very much
I have tested on small school and I found that a school with 10 names are separated in two pages although when reseting the page breaks, I found that the bottom table could be in the same first page without any problems. How can I adjust both cases?
I mean only take two names and the bottom table if any of the bottom table is isolated (away from each other).. in other words, the bottom table is considered one unity and this unity is fit to a page that is fine and no need to move them to another page.

User avatar
HansV
Administrator
Posts: 78232
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Adjust page breaks according to table

Post by HansV »

I see that we have to reset lp in the loop.
Immediately below the line

Code: Select all

        For i = LBound(aL) To UBound(aL)
insert

Code: Select all

            lp = 0
Best wishes,
Hans

YasserKhalil
PlatinumLounger
Posts: 4911
Joined: 31 Aug 2016, 09:02

Re: Adjust page breaks according to table

Post by YasserKhalil »

Amazing and awesome my tutor. Thank you very much for your great efforts.

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Re: Adjust page breaks according to table

Post by LisaGreen »

Nice catch Hans!!! Is there any documentation on the bug please?

Lisa

User avatar
HansV
Administrator
Posts: 78232
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Adjust page breaks according to table

Post by HansV »

Best wishes,
Hans

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Re: Adjust page breaks according to table

Post by LisaGreen »

Thank you Hans!