1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Private Sub CommandButton1_Click()
' Bouton Sélection Imprimante
Application.Dialogs(xlDialogPrinterSetup).Show
' Apercu avant imprime
Worksheets("Feuil2").PrintPreview
With Sheets("Feuil2")
With .PageSetup
.Orientation = xlLandscape 'paysage
.CenterHorizontally = True 'centré horizontalement
.CenterVertically = True 'centré verticalement
.LeftMargin = Application.InchesToPoints(0) 'marge gauche
.RightMargin = Application.InchesToPoints(0) 'marge droite
.TopMargin = Application.InchesToPoints(0) 'marge haut
.BottomMargin = Application.InchesToPoints(0) 'marge bas
.Zoom = False 'pas de zom
.FitToPagesTall = 1 '1 page en hauteur
.FitToPagesWide = 1 '1 page en largeur
End With
'imprime
ActiveSheet.PrintOut
End With
End Sub |