View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
ruben via OfficeKB.com ruben via OfficeKB.com is offline
external usenet poster
 
Posts: 6
Default insert page break

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