![]() |
best approach? or select last row before page break
Hi,
Now that I've got Row 16 auto adjusting to the necessary height, my last row on page one, Row 54, is also moving (of course!). The problem is this row is formatted with a bottom border for aesthetic purposes (regular formatting and conditional formatting). I tried to fix this by deleting an equal number of rows as space added to row 16 (If .RowHeight = 27 Then Rows(53).Delete and so on). The problem with that is then the rest of the sub, which hides select unused rows when printing, won't work since the row numbers referenced for that will have changed (and that change is variable). So... now I'm thinking that in between adjusting row 16 and hiding unused rows while printing (yes, they're in the same sub) if I can select whatever the last row is on page one and then format it, things may work. Is this even the best approach??? Of note, formatting for last row of page one applies to columns A - K, with A - H as a merged cell. My starting points: activesheet.Hpagebreaks(1).location.Address and/or With Hpagebreaks(1).Location.Offset( _ -1, 0).EntireRow.Borders(xlBottom) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With Of course, I don't want to apply the above to the entire row. I also don't know what to do about the conditional formatting which applies to the cell in column K. Thanks in advance for any and all help. |
best approach? or select last row before page break
I don't know about finding pagebreaks, but can you select
the new bottom row based on the height of row 16? -----Original Message----- Hi, Now that I've got Row 16 auto adjusting to the necessary height, my last row on page one, Row 54, is also moving (of course!). The problem is this row is formatted with a bottom border for aesthetic purposes (regular formatting and conditional formatting). I tried to fix this by deleting an equal number of rows as space added to row 16 (If .RowHeight = 27 Then Rows(53).Delete and so on). The problem with that is then the rest of the sub, which hides select unused rows when printing, won't work since the row numbers referenced for that will have changed (and that change is variable). So... now I'm thinking that in between adjusting row 16 and hiding unused rows while printing (yes, they're in the same sub) if I can select whatever the last row is on page one and then format it, things may work. Is this even the best approach??? Of note, formatting for last row of page one applies to columns A - K, with A - H as a merged cell. My starting points: activesheet.Hpagebreaks(1).location.Address and/or With Hpagebreaks(1).Location.Offset( _ -1, 0).EntireRow.Borders(xlBottom) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With Of course, I don't want to apply the above to the entire row. I also don't know what to do about the conditional formatting which applies to the cell in column K. Thanks in advance for any and all help. . |
All times are GMT +1. The time now is 09:55 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com