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.
Adjust page breaks according to table
-
- PlatinumLounger
- Posts: 4911
- Joined: 31 Aug 2016, 09:02
-
- Administrator
- Posts: 78232
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Adjust page breaks according to table
I see that we have to reset lp in the loop.
Immediately below the line
insert
Immediately below the line
Code: Select all
For i = LBound(aL) To UBound(aL)
Code: Select all
lp = 0
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4911
- Joined: 31 Aug 2016, 09:02
Re: Adjust page breaks according to table
Amazing and awesome my tutor. Thank you very much for your great efforts.
-
- 5StarLounger
- Posts: 964
- Joined: 08 Nov 2012, 17:54
Re: Adjust page breaks according to table
Nice catch Hans!!! Is there any documentation on the bug please?
Lisa
Lisa
-
- Administrator
- Posts: 78232
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Adjust page breaks according to table
This is the nearest I can find: You receive a "Subscript out of range" error message when you use HPageBreaks or VPageBreaks.Location in Excel
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 964
- Joined: 08 Nov 2012, 17:54
Re: Adjust page breaks according to table
Thank you Hans!