Page Breaks when data is NOT on column "A"

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
 
B

bhofsetz

Try using the Horizontal Page Break rather than just th
xlPageBreakManual

xlHPageBreaks.Ad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top