Please see attached sample. In this sample several departments are listed and below those departments are numbers representing rows of data being used for each department.
The problem is when you look at the page breaks and get to the last department on the 1st page, in this case, Department 3, we have rows of data that have to go on to page 2 due to the pagebreak. Is there a way (vba code?) that will look at the last department on the page, copy and paste that department name to the top of the 2nd page and then have the remaining data rows below it? Therefore, at the bottom of page 1 it would appear as:
and on page 2, it would then appear as follows:
The print titles to repeat at the top wont work since the range will always be different from page to page. Basically need a code that if the rows exceed past the page break it will copy and paste the department name at the top of the following page followed by the remaining rows of data.
Is this possible? Thanks!