Page Breaks when data is NOT on column "A"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The following works great EXCEPT it needs to put the
break in column A, NOT in B.
Help Please.
BeeJay

Dim OldVal As String
Dim Rng As Range
With Application
.Calculation = xlManual
.ScreenUpdating = False
End With
OldVal = Range("B1")
StartTime = Timer
For Each Rng In Range("B1:B10000") '<< change range

If Rng.Text <> OldVal Then
Rng.PageBreak = xlPageBreakManual
OldVal = Rng.Text
End If
Next Rng

MsgBox Timer - StartTime

With Application
.Calculation = xlAutomatic
.ScreenUpdating = True
End With

MsgBox "COMPLETE!"

End Sub
 
Try using the Horizontal Page Break rather than just th
xlPageBreakManual

xlHPageBreaks.Ad
 
Back
Top