Hallo Zusammen,
ich würde gerne den folgenden Code so modifiziert haben das er anstelle von "ActiveSheet.Range("A1:Q20")" den hinterlegten Druckbereich des Tabellenblattes als
PDF abspeichert.
Sub speichern_unter_PDF()
Dim sPath As String
sPath = ThisWorkbook.Path 'ANPASSEN
If sPath = "" Then
MsgBox "Die Datei muß zuerst gespeichert werden"
Exit Sub
End If
sPath = IIf(Right$(sPath, 1) = Application.PathSeparator, sPath, sPath & Application. _
PathSeparator)
Dim rng As Range
Set rng = ActiveSheet.Range("A1:Q20") 'ANPASSEN
On Error GoTo ENDE:
Application.DisplayAlerts = False
Dim PDF_NAME As String
PDF_NAME = sPath & "Export vom " & Format(Date, "dd.mm.yyyy") & ".pdf" 'ANPASSEN
If Not PDF_NAME = "Falsch" Then
rng.ExportAsFixedFormat Type:=xlTypePDF, FileName:=PDF_NAME, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
End If
ENDE:
Application.DisplayAlerts = True
End Sub
Kann mir jemand helfen?
Wäre super ...