Sub PDF()
Plaats = Range("$A$1").Value
Naam = Range("$A$2").Value
If Dir(Plaats & Naam & ".pdf") <> "" Then
antwoord = MsgBox("Het bestand: " & Naam & ".pdf bestaat reeds Vervangen?", vbYesNo)
If antwoord = vbYes Then
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Plaats & Naam & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=False, IgnorePrintAreas:=False, From:=1, To:=1, OpenAfterPublish:=False
Else
Exit Sub
End If
Else
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Plaats & Naam & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=False, IgnorePrintAreas:=False, From:=1, To:=1, OpenAfterPublish:=False
End If
End Sub