Hi friends,
I got a code from http://www.vbaexpress.com/forum/arch...p/t-13260.html website
this code applying for all sheets in a workbook. I want to apply only active worksheet. Please change code as Active Sheet mode
And Line going to across sheet. Can we control that line in a range, like I have a data in Range A1:K114, So will come A to K column only.
![]()
Sub BottomLine() Dim ws As Worksheet Dim pb As HPageBreak Dim LastRow As Long For Each ws In ThisWorkbook.Worksheets ActiveWindow.View = xlPageBreakPreview For Each pb In ws.HPageBreaks LastRow = pb.Location.Offset(-1, 0).Row Firstrow = pb.Location.Offset(0, 0).Row With ws.Rows(LastRow).Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlThin End With With ws.Rows(Firstrow).Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlThin End With Next pb Next ws End Sub
Bookmarks