Determine last row before end of page on worksheet
I am trying to develop some reports in Excel from VB6.0. The reports
have multiple records that can span several rows. Each record has a commments field in it, so the height of a cell can very greatly from record to record. What I am trying to figure out is an easy way to determine what was the last row on a page in excel, so that when it goes to a new page, it will reprint the title and the column names. Currently I am calculating the height of every row and then based on if the pagesetup is landscape or portrait, comparing that number to the total height of the page to determine when the page ends...Is there a simpler way to achieve this? |
Determine last row before end of page on worksheet
Have you tried setting the Rows to Repeat At Top property?
FilePageSetupSheetRows To Repeat at Top Hope this helps Rowan dclarkston wrote: I am trying to develop some reports in Excel from VB6.0. The reports have multiple records that can span several rows. Each record has a commments field in it, so the height of a cell can very greatly from record to record. What I am trying to figure out is an easy way to determine what was the last row on a page in excel, so that when it goes to a new page, it will reprint the title and the column names. Currently I am calculating the height of every row and then based on if the pagesetup is landscape or portrait, comparing that number to the total height of the page to determine when the page ends...Is there a simpler way to achieve this? |
All times are GMT +1. The time now is 06:15 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com