Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Inserting automatic page breaks

Have a list of books checked out to students. Need a page break at each
change in name.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Inserting automatic page breaks

Assuming names are in column A. Adjust to suit.

Sub InsertBreak_At_Change()
'Sandy Mann July 1st, 2007
Dim LastRow As Long
Dim X As Long
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False
For X = LastRow To 2 Step -1
If Cells(X, 1).Value < Cells(X - 1, 1).Value Then
If Cells(X, 1).Value < "" Then
If Cells(X - 1, 1).Value < "" Then
Cells(X, 1).PageBreak = xlPageBreakManual
End If
End If
End If
Next X
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Wed, 12 May 2010 16:15:01 -0700, LStewart
wrote:

Have a list of books checked out to students. Need a page break at each
change in name.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Inserting automatic page breaks



"Gord Dibben" wrote:

Assuming names are in column A. Adjust to suit.

Sub InsertBreak_At_Change()
'Sandy Mann July 1st, 2007
Dim LastRow As Long
Dim X As Long
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False
For X = LastRow To 2 Step -1
If Cells(X, 1).Value < Cells(X - 1, 1).Value Then
If Cells(X, 1).Value < "" Then
If Cells(X - 1, 1).Value < "" Then
Cells(X, 1).PageBreak = xlPageBreakManual
End If
End If
End If
Next X
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Wed, 12 May 2010 16:15:01 -0700, LStewart
wrote:

Have a list of books checked out to students. Need a page break at each
change in name.


.
This worked wonderfully!! Thank you so much!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Inserting automatic page breaks

Good to hear

Thanks for the feedback

On Fri, 14 May 2010 15:01:01 -0700, LStewart
wrote:



"Gord Dibben" wrote:

Assuming names are in column A. Adjust to suit.

Sub InsertBreak_At_Change()
'Sandy Mann July 1st, 2007
Dim LastRow As Long
Dim X As Long
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False
For X = LastRow To 2 Step -1
If Cells(X, 1).Value < Cells(X - 1, 1).Value Then
If Cells(X, 1).Value < "" Then
If Cells(X - 1, 1).Value < "" Then
Cells(X, 1).PageBreak = xlPageBreakManual
End If
End If
End If
Next X
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Wed, 12 May 2010 16:15:01 -0700, LStewart
wrote:

Have a list of books checked out to students. Need a page break at each
change in name.


.
This worked wonderfully!! Thank you so much!


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
When automatic page breaks are moved each cell becomes a new page Queso hotmail com> Excel Discussion (Misc queries) 0 March 30th 10 03:08 AM
Inserting page breaks Rich Mogy Excel Worksheet Functions 3 April 10th 09 11:26 PM
Inserting Page Breaks blasds78 Excel Discussion (Misc queries) 3 May 22nd 07 03:57 PM
Automatic page breaks Bob Johnson Excel Discussion (Misc queries) 0 September 28th 06 05:38 PM
Inserting Page Breaks chrisnelsonusa1 Excel Discussion (Misc queries) 3 December 9th 05 09:34 PM


All times are GMT +1. The time now is 01:31 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"