Sub Imprimer()
Application.PrintCommunication = False
On Error Resume Next
With ThisWorkbook.Worksheets("Feuil1").PageSetup
.PrintArea = ""
.Orientation = xlPortrait
.PaperSize = xlPaperA4
.Parent.PrintPreview
End With
With ThisWorkbook.Worksheets("Feuil2").PageSetup
.PrintArea = ""
.Orientation = xlPortrait
Application.PrintCommunication = True
.PaperSize = xlPaperA3
If Err Then
.PaperSize = xlPaperA4
MsgBox "Format A3 non supporté" & vbLf & vbLf & "A4 établi", vbCritical + vbOKOnly
Err.Clear
End If
Application.PrintCommunication = False
.Parent.PrintPreview
End With
With ThisWorkbook.Worksheets("Feuil3").PageSetup
.PrintArea = ""
.Orientation = xlPortrait
.PaperSize = xlPaperA4
.FitToPagesWide = 1: .CenterHorizontally = True
.FitToPagesTall = 1: .CenterVertically = True:
.Parent.PrintPreview
End With
Application.PrintCommunication = True
End Sub