im trying to select the first 3 rows after each page break and add a few grid lines
my main issue here is that im extremely confused about the row selection
my main issue here is that im extremely confused about the row selection
VBA Code:
Sub PageBreakSelection()
Dim hPage As HPageBreak
Dim rng As Range
' Set rng = ?
For Each hPage In ActiveSheet.HPageBreaks
hPage.Location.Select
With rng
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
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
End With
Next hPage
End Sub