VBA · Administration

Alle sichtbaren Blätter als einzelne PDFs exportieren

Exportiert jedes sichtbare Arbeitsblatt als separate PDF-Datei in einen Unterordner.

VBA
Sub AlleBlaetterAlsPDF()
    Dim ws As Worksheet, ordner As String
    If ThisWorkbook.Path = "" Then Exit Sub
    ordner = ThisWorkbook.Path & "\PDF_Export"
    If Dir(ordner, vbDirectory) = "" Then MkDir ordner
    For Each ws In ThisWorkbook.Worksheets
        If ws.Visible = xlSheetVisible Then
            ws.ExportAsFixedFormat xlTypePDF, ordner & "\" & ws.Name & ".pdf"
        End If
    Next ws
    MsgBox "Export abgeschlossen: " & ordner, vbInformation
End Sub
VBAExcelPDFExport
WA