I found multiple examples for checking if a certain Sheet matches with one Name, but I need to check if one of the sheets in my Workbook (at least 70 Sheets) is a Item on a List ( at least 30 Names).
If a Sheet matches, convert to PDF, resume.
Sub PDFAlle2()
Dim w, ws As Worksheet
wsListe As String
Dim fName As String
wsListe = Sheets("Liste").Range("B3:B5")
On Error Resume Next
For Each ws In ActiveWorkbook.Sheets
If ws.Name = wsListe Then '<-- this obviously doesn't work
With ActiveSheet
fName = .Range("E2").Value & "Ausdruck"
.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\PDFTest\" & fName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=True, OpenAfterPublish:=False
End With
End If
Next ws
End Sub