I am looking for an Excel VBA code that could count the last remaining rows of a print area page (Landscape) and decide whether there is enough number of rows available or not to copy/paste the text from another worksheet to active worksheet.
For example:
I have an Invoice template in excel. The Invoice ends with a Grand Total at the very end. I would like to add my Terms and Conditions policy after a space of one blank row under the Grand Total every time. My T&C consists of three paragraphs which are in a merged cell that takes a space of 14
rows.
The invoice can go to any number of pages, my requirement is, on whatever the last page the Grand Total occurs there should be a space of 16 rows at least available underneath it to copy/paste the T&C if that many rows are not available then T&C should be moved to the next page automatically. Basically, I do not want the T&C to be half printed on two separate pages. I have T&C on a separate worksheet which I need to copy/paste to active worksheet i.e. Invoice worksheet under Grand Total. I hope everything makes sense.
Here is the accompanying demo video of what I am looking for. Any help would really be appreciated. Thank you in advance.