Sub PDFActiveSheet()
'sur un code de Debra Dalgleish, j'ai juste francisé la chose
'et ajouté un chouià ou deux ;-)
Dim ws As Worksheet, strPath$
Dim myFile As Variant, strFile$
On Error GoTo errHandler
Set ws = ActiveSheet
strFile = ws.Name & Space(1) & ws.Range("A1").Text & ".pdf"
strFile = ThisWorkbook.Path & "\" & strFile
myFile = Application.GetSaveAsFilename _
(InitialFileName:=strFile, _
FileFilter:="Fichier PDF (*.pdf), *.pdf", _
Title:="Selectionner le dossier et le nom du PDF à créer")
If myFile <> False Then
ws.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=myFile, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
MsgBox "Le PDF a bien été créé."
End If
'
exitHandler:
Exit Sub
errHandler:
MsgBox "PDF non créé", vbCritical
Resume exitHandler
End Sub