Try using the following code where a1 is the location of the first name:
Range("a1").Select
For i = 1 To 10
If Not ActiveCell.Value = ActiveCell.Offset(1, 0).Value Then
ActiveWindow.SelectedSheets.HPageBreaks.Add before:=ActiveCell.Offset(1, 0)
End If
ActiveCell.Offset(1, 0).Select
Next i
End Sub
I hope this helps.
Kind regards, Al.
Like this thread? Share it with others