Try out this process
Sub CreatePDFInvoice()
Dim wsi, ws1 As Worksheet
Dim FilePath, strFName, AttachmentPath As String
Dim i, lr As Long
Set wsi = Sheet1
Set ws1 = Sheet2
lr = ws1.Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To lr
wsi.[C10].Value = ws1.Range("A" & i) & " " & ws1.Range("B" & i)
wsi.[C11].Value = ws1.Range("C" & i)
wsi.[C12].Value = ws1.Range("D" & i)
wsi.[C13].Value = ws1.Range("E" & i)
wsi.[C14].Value = ws1.Range("F" & i)
wsi.[H6].Value = ws1.Range("G" & i)
wsi.[H7].Value = ws1.Range("H" & i)
FilePath = ThisWorkbook.Path & "\"
strFName = ws1.Range("A" & i) & "_" & ws1.Range("B" & i) & "_" & ActiveSheet.Name
AttachmentPath = FilePath & strFName & ".pdf"
wsi.UsedRange.ExportAsFixedFormat Type:=xlTypePDF, Filename:=AttachmentPath, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
Next i
End Sub
Bookmarks