Bonjour,
Sub Imprimer()
'Macro par Claude Dubois pour "" Excel-Pratique le 01/02/11
Dim Lg%, Lg2%, Nb%, i%, x%, y%
With ActiveSheet
Lg2 = .Range("a65536").End(xlUp).Row
Nb = Application.CountIf(.Range("a:a"), "Customer account :") 'nombre pavés
Lg = 1
For i = 1 To Nb
x = Lg + WorksheetFunction.Match("Customer account :", _
Range(.Cells(Lg, 1), .Cells(Lg2, 1)), 0)
Lg = x
y = 0
On Error Resume Next
y = Lg + WorksheetFunction.Match("Customer account :", _
Range(.Cells(Lg, 1), .Cells(Lg2, 1)), 0) - 1
On Error GoTo 0
If y = 0 Then y = Lg2 + 2 '--- dernier pavé ---
.PageSetup.PrintArea = Range(.Cells(x - 1, 1), .Cells(y - 2, "j")).Address
.PrintPreview '--- aperçu ---
'.PrintOut copies:=1 '--- imprime ---
Next i
End With
End Sub
à réactiver la dernière ligne si Ok et supprimer l'aperçu
Salut Banzai64
Amicalement
Claude