Hopefully this qualifies as a programming issue given I don't think I can achieve this without VBA.
I have an Excel 2016 range, fixed in size and contents (x amount of rows), but given there's an expanding table above, moves up and down. It's essentially a signature right at the end.
I want to avoid splitting the printout of this range over two pages, hence need to add a page break before this specific range in case a part of it spills over to page 2 - and then to be fully printed on page 2, not just part of the range as it happens by default. Also, no need for this page break unless it all fits on page 1.
I do have a working code which I could enhance a bit to manually add page break in front of a range, but that would need this to be launched manually whenever the user sees a range partly spilling over to the next page - perhaps it's possible to automate this?
Any ideas on the possible approach?
Sub Page_break()
Dim CellRange As Range
Dim TestCell As Range
ActiveSheet.ResetAllPageBreaks
Set CellRange = Selection
For Each TestCell In CellRange
If TestCell.Value <> TestCell.Offset(-1, 0).Value Then
ActiveSheet.Rows(TestCell.Row).PageBreak = xlPageBreakManual
End If
Next TestCell
End Sub