Howdy,
This is my first post...Thanks for help.
The following code works but runs very slow:
[vba]Sub AutoPageBreak()
Dim LastRow As Long
Dim Count As Long
Application.ScreenUpdating = False
LastRow = Worksheets("Audit").Range("D65536").End(xlUp).Row
LastRow = LastRow + 1
For Count = 4 To LastRow
If Cells(Count, "B") <> Cells(Count - 1, "B") Then
Worksheets("Audit").Rows(Count).PageBreak = xlPageBreakManual
End If
Next Count
Application.ScreenUpdating = True
End Sub [/vba]
It sets pagebreaks between names in column B when they are different. There are thousands (3-6k) of rows with data and at least 300 pagebreaks.
My questions are: Is it slow due to clunky coding or does setting the pagebreaks bog it down? Is there a more elegant solution?
I combat code to get things working, but I would like to improve my understanding of VBA.
Thanks again...