I have a code that generates excel files and at the end of the worksheet there is a table like that I am using this line to determine the print area and that's fine till now
Code: Select all
.PageSetup.PrintArea = "$A$1:$H$" & n + 6
For example, if you look at the snapshot, you will find that the page ends at row 179 so the bottom table will be in another page. In that case I need to include two of the names and the table in a separate sheet. I mean the last page should start at row 176 (to include two of the names plus the bottom table)
*if the bottom table appears completely with at least one name that is OK (I am talking about the last page only)
* The bottom table I mean from row 179 to row 184
The snapshot of the desired page break in that case would to be like that