Sub
PDF_Erzeugen()
Application.ScreenUpdating =
False
Dim
Monat
Dim
Jahr
Dim
Reitername
Dim
LetzteZeile
Monat = Sheets(
"Admin"
).Range(
"B1"
).Value
Jahr = Sheets(
"Admin"
).Range(
"B2"
).Value
LetzteZeile = Worksheets(
"Admin"
).Cells(Rows.Count, 6).
End
(xlUp).Row
Application.DisplayAlerts =
False
For
i = 2
To
LetzteZeile
If
Worksheets(
"Admin"
).Range(
"G"
& i).Value =
"x"
Then
Reitername = Worksheets(
"Admin"
).Range(
"F"
& i).Value
Sheets(Reitername).Activate
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=
"M:\Abteilung Marketing\SoFi\02 PROMOTIONPAKETE\" & Jahr & "
\
" & Monat & "
\
" & Reitername & "
.pdf", Quality:=xlQualityStandard, IncludeDocProperties:=
True
, IgnorePrintAreas:=
False
, OpenAfterPublish:=
False
End
If
Next
i
Application.DisplayAlerts =
True
Application.ScreenUpdating =
True
MsgBox
"PDF-Erzeugung erfolgreich"
End
Sub