Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old May 11th 06, 05:30 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: May 2006
Posts: 6
Default insert page break

Hi all,

I have an excel sheet where hundreds of invoices are found and would like to
insert page breaks after the word 'Total' is being displayed. Is that
possible?

Thks in advance

--
Message posted via http://www.officekb.com

  #2   Report Post  
Old May 11th 06, 08:35 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2006
Posts: 718
Default insert page break

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
'---------------
"ruben via OfficeKB.com" <[email protected] a écrit dans le message de news:
[email protected]
Hi all,

I have an excel sheet where hundreds of invoices are found and would like
to
insert page breaks after the word 'Total' is being displayed. Is that
possible?

Thks in advance

--
Message posted via http://www.officekb.com



  #3   Report Post  
Old May 11th 06, 10:43 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: May 2006
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
  #4   Report Post  
Old May 11th 06, 11:57 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2006
Posts: 718
Default insert page break

Thanks for the feedback!

Cheers,
--
AP

"ruben via OfficeKB.com" <[email protected] a écrit dans le message de news:
[email protected]
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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Page Break da Excel Discussion (Misc queries) 2 May 11th 09 07:05 PM
How do I insert a page break between every row and column? Ashley Excel Discussion (Misc queries) 2 February 26th 09 04:21 AM
INSERT ROW AND PAGE BREAK jcontrer Excel Discussion (Misc queries) 0 May 15th 08 07:09 PM
cannot insert page break tsmanz Excel Discussion (Misc queries) 2 December 5th 05 06:45 PM
Insert Page Break Don Excel Discussion (Misc queries) 3 June 9th 05 08:32 PM


All times are GMT +1. The time now is 09:27 PM.

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright ©2004-2019 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017