Andy
There may be an easier way, but this should work.
For the first sheet, I have assumed the client name is in A5. If this is incorrect, you will need to adjust.
After that, the code looks for each pagebreak. Since they are set at the change of the client names in Column1, I have assumed the first cell in Col1 after the pagebreak will contain the client name.
It is then a matter of looping through the pagebreaks. As you will see, each page has to be printed separately.
Sub PrintPages()
Dim x As Integer 'Declare a variable to hold break number
With Worksheets("Sheet1")
.[B2] = .[A5] 'Copy the first client to B2
.Worksheets("Sheet1").PrintOut from:=1, To:=1, copies:=1 'Print the first page
x = .HPageBreaks.Count 'Count the number of pagebreaks to establish the number of pages to print
For x = 1 To x 'For the number of pagebreaks
.[B2] = .Range(.HPageBreaks(x).Location.Address) 'Client name will fill columnA, so copy to B2
.Worksheets("Sheet1").PrintOut from:=x + 1, To:=x + 1, copies:=1 'Print the page - number will be PageBreak number plus 1
Next x
End With
End Sub
Unfortunately, I have not had a chance to test this.
Any help?
Regards
Robb__