title: Export sheets top pdf bases on cell values
body: <p>I am trying to export different sets of sheets to specified maps as pdf format.
  The workbook contains multiple sheets and in the sheet Printlist i have a list of the specified sheets, filenames and maps. (see image)</p>
  
  <p>I want to write a macro that prints te sheetnames with the filenames to the specified maps but my current macro does not do the trick
  <img src="https://i.stack.imgur.com/e9NQU.jpg" alt="![sheet">]<a href="https://i.stack.imgur.com/e9NQU.jpg" rel="nofollow noreferrer">1</a> 
  Code:</p>
  
  <pre><code>Sub PDF_maken()
  
  Dim ws As Worksheet
  Dim LR As Long
  Dim r As Range
  Dim Mypath As String
  
  Set ws = ActiveWorkbook.Worksheets("Printlijst")
  LR = ws.Cells(Rows.Count, 1).End(xlUp).Row
  
  For Each r In ws.Range("B2:B" &amp; LR)
  
  If Not IsEmty("B" &amp; r) Then
  Mypath = ws.Range("B" &amp; r).Text
  Sheets(Array(ws.Range("D" &amp; r).Text, ws.Range("E" &amp; r).Text, ws.Range("F" &amp; r).Text, ws.Range("G" &amp; r).Text)).Select
  ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
  Mypath &amp; ws.Range("C" &amp; r).Text &amp; ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, _
   IgnorePrintAreas:=False, OpenAfterPublish:=False
  End If
  
  Next r
  
  End Sub
  </code></pre>