Specific requirements are a little fuzzy so if this needs tweaking, let me know
It's a little tricky to know where the page breaks are since it depends on the selected printer, fonts, etc.
This assumes there is a default printer and that the pages are 1 wide
Option Explicit
Sub PageBox()
Dim rBox As Range
Dim aBreaks() As Long
Dim i As Long, iLast As Long
ActiveWindow.View = xlPageBreakPreview
With ActiveSheet
iLast = .UsedRange.Rows.Count
ReDim Preserve aBreaks(1 To 1)
aBreaks(1) = 1
For i = 1 To iLast
If .Rows(i).PageBreak = xlPageBreakAutomatic Then
ReDim Preserve aBreaks(1 To UBound(aBreaks) + 1)
aBreaks(UBound(aBreaks)) = i
End If
Next i
If .Rows(iLast).PageBreak <> xlPageBreakAutomatic Then
ReDim Preserve aBreaks(1 To UBound(aBreaks) + 1)
aBreaks(UBound(aBreaks)) = iLast + 1
End If
With .Cells
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
End With
For i = LBound(aBreaks) To UBound(aBreaks) - 1
Set rBox = Intersect(Range(.Rows(aBreaks(i)), .Rows(aBreaks(i + 1) - 1)), .UsedRange)
With rBox
' msgbox .Address
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
With .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With .Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
End With
Next i
End With
End Sub