View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Print group of records with same Customer name

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

On Wed, 18 Nov 2009 10:51:03 -0800, Freddy
wrote:

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.