Private Sub Impression_Click()
Dim DerLig As Long
Set aff = Sheets("affectation")
With aff
DerLig = Cells.Find("*", , , , xlByRows, xlPrevious).Row
With .PageSetup
.PrintTitleRows = "$A$1:$F$5" 'Copie 5 lignes sur chaque page
.PrintArea = "A1:F" & DerLig ‘Impression jusqu’à dernière ligne non vide
.PaperSize = xlPaperA4 'Format A4
.Orientation = xlPortrait 'Impression portrait
.LeftMargin = Application.InchesToPoints(0.25) 'définition des marges
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.25)
.BottomMargin = Application.InchesToPoints(0.25)
.Zoom = False
.FitToPagesWide = 1 'adaptation largeur feuille
End With
.PrintPreview
End With
End Sub