Hi I am using the following macro code to save a sheet as a PDF. However the name of the saved PDF comes out as the the worksheet name which is called Standard Template.
I was wondering if anyone knew how to edit the code so that the name comes out as the following: Invoice #(value of cell H5)
Cell H5 contains a unique invoice number so for example if cell H5 had the number 10 in it then the PDF would save as Invoice #10
Any help would be appreciated.
I was wondering if anyone knew how to edit the code so that the name comes out as the following: Invoice #(value of cell H5)
Cell H5 contains a unique invoice number so for example if cell H5 had the number 10 in it then the PDF would save as Invoice #10
Code:
Sub Create_PDF_Invoice()
Dim wsh As Worksheet, vWshs, vWshName
vWshs = Array("Standard Template")
With ActiveWorkbook
For Each vWshName In vWshs
.Worksheets(vWshName).ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"D:\Finance\Invoices Sent\" & vWshName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
Next vWshName
End With
End Sub
Any help would be appreciated.