Sub InsertPageBreaksAfterDoubleAA()
Dim ws As Worksheet
Dim rng As Range
Dim cell As Range
Dim aaCount As Integer
Dim lastRow As Long
Set ws = ThisWorkbook.Sheets("Sheet1")
lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
Set rng = ws.Range("A1:A" & lastRow)
aaCount = 0
For Each cell In rng
If cell.Value = "AA" Then
aaCount = aaCount + 1
If aaCount = 2 Then
ws.HPageBreaks.Add Before:=cell.Offset(1, 0)
aaCount = 0
End If
End If
Next cell
End Sub
Dim ws As Worksheet
Dim rng As Range
Dim cell As Range
Dim aaCount As Integer
Dim lastRow As Long
Set ws = ThisWorkbook.Sheets("Sheet1")
lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
Set rng = ws.Range("A1:A" & lastRow)
aaCount = 0
For Each cell In rng
If cell.Value = "AA" Then
aaCount = aaCount + 1
If aaCount = 2 Then
ws.HPageBreaks.Add Before:=cell.Offset(1, 0)
aaCount = 0
End If
End If
Next cell
End Sub