Thread: [Solved] Bottom Line in every page
View Single Post
 
Old 08-16-2022, 01:14 PM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2019
Expert
 
Join Date: Apr 2014
Posts: 867
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Untested, try:
Code:
Sub BottomLine2()
Dim ws As Worksheet
Dim pb As HPageBreak
Dim LastRow As Long


For Each ws In ThisWorkbook.Worksheets
  origview = ActiveWindow.View
  ActiveWindow.View = xlPageBreakPreview

  For Each pb In ws.HPageBreaks
    LastRow = pb.Location.Offset(-1, 0).Row
    With ws.Range("B" & LastRow & ":H" & LastRow).Borders(xlEdgeBottom)
      .LineStyle = xlContinuous
      .Weight = xlThin
    End With
  Next pb
  ActiveWindow.View = origview
  'ws.DisplayPageBreaks = False
Next ws
End Sub
There's a commented out line you can add if you find you have unwanted pagebreaks showing.
Reply With Quote