View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ardus Petus Ardus Petus is offline
external usenet poster
 
Posts: 718
Default insert page break

Thanks for the feedback!

Cheers,
--
AP

"ruben via OfficeKB.com" <u21729@uwe a écrit dans le message de news:
601598b4c7716@uwe...
Ardus Petus wrote:
Try this:

HTH
--
AP

'---------------
Sub InsertPB()
Dim rTotal As Range
Dim sFirstFound As String
With ActiveSheet
Set rTotal = .UsedRange.Find( _
what:="Total", _
lookat:=xlWhole)
If Not rTotal Is Nothing Then
sFirstFound = rTotal.Address
Do
.HPageBreaks.Add befo=rTotal.Offset(1, 0)
Set rTotal = .UsedRange.FindNext(after:=rTotal)
Loop Until rTotal.Address = sFirstFound
End If
End With
End Sub
'---------------
Hi all,

[quoted text clipped - 4 lines]

Thks in advance


Thanks AP,

Works just fine. U'r a genius.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200605/1