Quote:
Originally Posted by jaimeA
Thank you, this works on 80% of the cases, but realize something else, not all the Authors will have a Total 2, some of them only have a Total 1. Any idea on how I can work around this? Thanks
|
I found something that works:
Sub Macro1()
Dim LRow As Long
Dim rngC As Range
With ActiveSheet
LRow = .Cells(Rows.Count, 1).End(xlUp).Row
.ResetAllPageBreaks
For Each rngC In Range("A6:A" & LRow)
If rngC Like "*(?????)" Then
.HPageBreaks.Add rngC.Offset(1, 10)
End If
Next
End With
End Sub
I found that the common denominator here was the ID between parenthesis. So this works, I just need it to insert the page break before that line and not after like it is doing it right now. Any ideas?? Thanks for the code!