rrenis
05-21-2014, 06:04 AM
Hi, I'm using the following code to save me removing and re-adding lines to the bottom of each page in a spreadsheet (the sheet in question is framed with a border for each page) when I insert or delete row. Whilst it saves time re-formatting when a hard copy is needed the only thing missing is the final aesthetic of 'padding out' the final page of the spreadsheet with blank rows to fill the page so that it is framed as a full page when printed out.
For Each rw In range("A6:XFD10000").Rows
rw.Borders(xlEdgeBottom).LineStyle = xlNone
Next
For Each pgbr In ActiveSheet.HPageBreaks
With pgbr.Location.Offset(-1, 0).EntireRow.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
End With
Next
Whilst it's no real hardship inserting or deleting a few rows to ensure the final page of the spreadsheet is a full page with a border when printed but I just wondered whether anyone out there has found themselves in this position and found a solution that they would be willing to share so that it could all be done from a single macro? :*)
Thanks in advance :)
Cheers,
rrenis
For Each rw In range("A6:XFD10000").Rows
rw.Borders(xlEdgeBottom).LineStyle = xlNone
Next
For Each pgbr In ActiveSheet.HPageBreaks
With pgbr.Location.Offset(-1, 0).EntireRow.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
End With
Next
Whilst it's no real hardship inserting or deleting a few rows to ensure the final page of the spreadsheet is a full page with a border when printed but I just wondered whether anyone out there has found themselves in this position and found a solution that they would be willing to share so that it could all be done from a single macro? :*)
Thanks in advance :)
Cheers,
rrenis