Try something like this...
Sub findpagebreak()
Dim ws As Worksheet, rng2 As Range
Set ws = ActiveSheet 'Sheets("Quote Sheet")
With ws.HPageBreaks
If .Count > 0 Then
MsgBox .Item(1).Location.Row, , "Page break row"
Set rng2 = ws.Range("A22:A150").Find(What:="2", _
After:=ws.Range("A" & .Item(1).Location.Row), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False)
If Not rng2 Is Nothing Then
MsgBox rng2.Row, , "Previous '2' row"
.Add rng2.Offset(1)
Else
MsgBox "No '2' found previous to the PageBreak."
End If
Else
MsgBox "No Page Breaks on this Sheet"
End If
End With
End Sub
Bookmarks