Sub ImpressionPDF()
ActiveSheet.Unprotect "0204"
Fichier = Range("F5") & ".pdf"
Dossier = "L:\Etude R&R\2021\"
Chemin = Dossier & Fichier
ActiveSheet.PageSetup.PrintArea = "$A$1:$R$45"
choix = MsgBox("Imprimer tout ?", vbQuestion + vbYesNoCancel + vbDefaultButton2, "Impression")
If choix = vbCancel Then Exit Sub
If choix = vbNo Then
' imprimer feuille
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Chemin
ActiveSheet.PageSetup.PrintArea = ""
Else
' imprimer tout
Application.ScreenUpdating = False
savSelection = [F5]
For Each c In [F5]
[F5] = c.Value
ActiveSheet.ExportAsFixedFormat Type:=xlsTypePDF, Filename:=Chemin
Next c
[F5] = savSelection
End If
ActiveSheet.PageSetup.PrintArea = ""
ActiveSheet.Protect "0204", True, True, True
End Sub