Print group of records with same Customer name

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.
 
G

Gord Dibben

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top