Hi,
A user of mine downloads reports from a database that puts between 1 and 6 tables on each worksheet.
I wrote a simple macro for her that inserts a page break after each table based on text in the bottom row, so that each table prints on a different page. (They vary in height, but always fit on a single page.)
She would like it modified so that, wherever possible, it fits two tables on a page.
The tables vary somewhat in width from one download session to the next. The sheets are always set to print 1 page wide. The “pages tall” box is left blank. So the percentage of normal size that it’s printed at will vary.
I can think of no way to do this but to:
A) set the page breaks one at a time in descending order,
and then
after each new break, check for the location of the next break after that one, to see if it falls below the next two tables, in which case I’d put both of them on the same sheet.
But, being not terribly familiar with pagebreaks, I don’t know whether this is even achievable.
So my questions are: is there a better way to do this? And if not, is it doable at all?
Thanks very much