Prev: Reference cell error
Next: Hi
From: LStewart on 12 May 2010 19:15 Have a list of books checked out to students. Need a page break at each change in name.
From: Gord Dibben on 13 May 2010 09:39 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 <LStewart(a)discussions.microsoft.com> wrote: >Have a list of books checked out to students. Need a page break at each >change in name.
From: LStewart on 14 May 2010 18:01 "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 > <LStewart(a)discussions.microsoft.com> 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!
From: Gord Dibben on 14 May 2010 18:08 Good to hear Thanks for the feedback On Fri, 14 May 2010 15:01:01 -0700, LStewart <LStewart(a)discussions.microsoft.com> 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 >> <LStewart(a)discussions.microsoft.com> 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!
|
Pages: 1 Prev: Reference cell error Next: Hi |