Hello!
I am creating financial reports (populated by uploaded data) and would like to write a macro to insert a page break; however, where the page break should be can change month to month. Is there a way to write a code in such a way that it will not break a 5-line grouping up?
For example, all my segments are:
Header 1
Revenue
Expense
Net Income
{blank line}
At different months, the automatic page break may cut between Revenue and Expense or Expense and Net Income, all depending on how many segments were active that month. I need the macro to read these groupings and if a segment is divided, insert a page break prior to the header.
Everything I can find either sets the page break at a certain word or after a certain number of lines which I cannot utilize for this issue. Is this macro possible?
Sample Picture.png
Bookmarks