LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Page Break when a column changes

Hi again,

Am Mon, 18 Nov 2013 21:55:42 +0100 schrieb Claus Busch:

Sub PageBreak()
Dim LRow As Long
Dim rngC As Range

With ActiveSheet
LRow = .Cells(Rows.Count, 1).End(xlUp).Row
.ResetAllPageBreaks
For Each rngC In Range("A6:A" & LRow + 1)
If Left(rngC, 1) < "T" Then
.HPageBreaks.Add rngC
End If
Next
End With
End Sub


better try:

Sub PageBreak()
Dim LRow As Long
Dim rngC As Range

With ActiveSheet
LRow = .Cells(Rows.Count, 1).End(xlUp).Row
.ResetAllPageBreaks
For Each rngC In Range("A6:A" & LRow + 1)
If Left(rngC, 5) < "Total" Then
.HPageBreaks.Add rngC
End If
Next
End With
End Sub


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
 
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
Excel 2007 Page Break Adjustments causes a page break each cell BKaufman Excel Worksheet Functions 2 September 10th 10 05:02 AM
How do I insert a page break between every row and column? Ashley Excel Discussion (Misc queries) 2 February 26th 09 03:21 AM
insert page break at each change in column B cbuck Excel Programming 4 October 31st 07 06:30 PM
Page Break Column Headers John Walker Excel Worksheet Functions 1 July 6th 07 12:25 AM
any way to redisplay column headings after page break? Gerald Morris Excel Worksheet Functions 2 June 29th 05 06:39 PM


All times are GMT +1. The time now is 02:00 PM.

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

About Us

"It's about Microsoft Excel"