Sub Export_PDF()
Dim objShell, LeNom$, strPath$, Cptr As Byte, ZoneImprim
Cptr = WorksheetFunction.Sum(Worksheets("Feuil1").Range("B4,B16,B29"))
Select Case Cptr
Case 1
ZoneImprim = "$D$2:$K$12"
Case 2
ZoneImprim = "$D$2:$K$25"
Case 3
ZoneImprim = "$D$2:$K$38"
End Select
With ActiveSheet.PageSetup
.PrintArea = ZoneImprim
.Orientation = xlLandscape ' mode paysage ==> A choisir
'.Orientation = xlPortrait ' mode portrait ==> A choisir
End With
Set objShell = CreateObject("Wscript.Shell")
strPath = objShell.SpecialFolders("MyDocuments") & "\"
LeNom = Sheets("Donnees").[O2]
ActiveSheet.ExportAsFixedFormat xlTypePDF, strPath & LeNom & ".pdf"
MsgBox "Le fichier PDF est...