How to create PDF that will auto save at the location base on specific cell name.

%3CLINGO-SUB%20id%3D%22lingo-sub-1428426%22%20slang%3D%22en-US%22%3EHow%20to%20create%20PDF%20that%20will%20auto%20save%20at%20the%20location%20base%20on%20specific%20cell%20name.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1428426%22%20slang%3D%22en-US%22%3E%3CP%3ESub%20PayrollPDF()%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESheet6.Range(%22A1%3AH44%22).ExportAsFixedFormat%20xlTypePDF%2C%20FileName%3A%3D%22%2FUsers%2Farthurlau%2FDesktop%2FSHK%2FPayroll%2FStaff%2FSheet6.Range(%22B8%22)%2F%22%20%26amp%3B%20Sheet6.Range(%22B8%22)%20%26amp%3B%20Format(Sheet6.Range(%22H6%22)%2C%20%22mm-yy%22)%2C%20openafterpublish%3A%3DTrue%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEnd%20Sub%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20save%20the%20pdf%20to%20the%20folder%20base%20on%20the%20excel%20cell%20%22B8%22.%20This%20is%20the%20code%20i%20am%20using%2C%20unfortunately%20it%20show%20syntax%20error.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFurther%20more%2C%20is%20that%20possible%20to%20code%20if%20today%20%3D%201st%20January%2C%20the%20value%20will%20be%20refresh%20to%20%2214%22%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1428426%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%20on%20Mac%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Visitor

Sub PayrollPDF()

 

Sheet6.Range("A1:H44").ExportAsFixedFormat xlTypePDF, FileName:="/Users/arthurlau/Desktop/SHK/Payroll/Staff/Sheet6.Range("B8")/" & Sheet6.Range("B8") & Format(Sheet6.Range("H6"), "mm-yy"), openafterpublish:=True

 

End Sub

 

I am trying to save the pdf to the folder base on the excel cell "B8". This is the code i am using, unfortunately it show syntax error. 

 

Further more, is that possible to code if today = 1st January, the value will be refresh to "14"?

0 Replies