I apologize in advance for the translation, as English is not my native language. I am trying to automate my work in excel and have already implemented almost everything I have in mind. Two problems remain. There can always be a different number of data rows in my document, for which I do automatic height adjustment. For the rest of the lines that fall on the last sheet, I set the height to 40mm. There are two problems: the first is due to the fact that the rows stretch depending on the data in them and every day a different number of rows, I can not determine exactly where the last page should end. Therefore, I cannot determine exactly what the Print Area should be in order to fit all the pages with information as well as empty lines on the last page. There must be a way to determine the end of the last page with information via VBA
The second problem is that when I set the automatic height adjustment of the rows, they adjust to the information in them. When a page tries to accommodate rows, those that no longer fit on the current page jump to the next one. In this case, there is a lot of empty space on the current page. To fill it, I can evenly stretch the remaining lines to the full height of the sheet. But I would like to do this automatically via VBA
P.S. I apologize for the lack of screenshots. This is the kind of work where you can’t take screenshots and photos.