Bonjour
un petit oubli a voir
Sub pdf()
'
' pdf Macro
'
If Range("F3") = 1 Then ' =1
' Range("A1:E25").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$E$25"
Chemin = "G:\Bon de commande\"
Fichier = ActiveSheet.Range("F3") & Format(Now(), "-mmmm" & "-yyyy") & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Chemin & Fichier, Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
'MsgBox ("avec tarif")
Else
ActiveSheet.PageSetup.PrintArea = "$F$1:$K$25"
' Range("F1:K25").Select
Chemin = "G:\Bon de commande\"
Fichier = ActiveSheet.Range("F3") & Format(Now(), "-mmmm" & "-yyyy") & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Chemin & Fichier, Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
'MsgBox ("sans tarif")
End If
End Sub
A+
Maurice