View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
BEEJAY BEEJAY is offline
external usenet poster
 
Posts: 247
Default Page Breaks when data is NOT on column "A"

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