Print group of records with same Customer name

  • Thread starter Thread starter Freddy
  • Start date Start date
F

Freddy

I'd like some assistance in writing VBA version 6 code in Excel 2002. I have
a spreadsheet that has the following column headers:

Customer-Project-Site-TFID-Point-Run Hours

Under each column header could be a varying amount of customer names with
varying amounts of rows. What I'd like to do is, for each different customer
name, print the associated rows altogether. Please note that the rows are
already sorted in ascending order by Customer then Project, i.e., they are
not scattered in different rows. Please notify me of any other information
needed to develop a solution.
 
Sub InsertBreak_At_Change()
Dim i As Long
For i = Columns(1).Rows.Count To 1 Step -1
If Selection(i).Row = 1 Then Exit Sub
If Selection(i) <> Selection(i - 1) And Not IsEmpty _
(Selection(i - 1)) Then
With Selection(i)
.PageBreak = xlPageBreakManual
End With
End If
Next
End Sub


Gord Dibben MS Excel MVP
 
Back
Top