View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Page Break when a column changes

Hi Jaime,

Am Mon, 18 Nov 2013 20:24:28 +0000 schrieb 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?


then try:

Sub PageBreak()
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 + 1)
If Left(rngC, 1) < "T" Then
.HPageBreaks.Add rngC
End If
Next
End With
End Sub


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2