How Do I Use Excel To Create A PDF Into A Folder According To A Cell?

Upload and start working with your PDF documents.
No downloads required

How To Create PDF Online?

Upload & Edit Your PDF Document
Save, Download, Print, and Share
Sign & Make It Legally Binding

How do I use Excel to create a PDF into a folder according to a cell name?

ExportAsFixedFormat applies to workbook and worksheet objects, not ranges. So I modified your code to copy Sheet6 to a new workbook, then clear all cells except A1.H44. Next, I change the slashes in your path to back slashes. Finally, I built your path using variables for the folder and filename. The code shown below contains my test path as well as yours. I know the code works with my path. If it doesn’t for your path, make sure the path exists and is correct. Sub PayrollPDF Dim foldr As String, flName As String Dim wb As Workbook Dim ws As Worksheet Set ws = Sheet6 With ws foldr = .Range("B8").Value flName = .Range("B8").Value & Format(Sheet6.Range("H6").Value, "mm-yy") & ".pdf" .Copy End With Set wb = ActiveWorkbook With wb.Worksheets(1) .Range("45." & Rows.Count).EntireRow.Clear .Range("I.XFD").EntireColumn.Clear .ExportAsFixedFormat xlTypePDF, _ Filename.="\Users\arthurlau\Desktop\SHK\Payroll\Staff\" & fldr & ""\"" & flName

Customers love our service for intuitive functionality

4.5

satisfied

46 votes

Create PDF: All You Need to Know

Value(0). File. Name. ToUpper() End With Set WS = WS. Sheets(1). Range(‛Rows. Count). First Set WS = WS. Sheets(1). Range(‛Cells(“45 & Rows. Count). Name). Item(‛A1) Set WS = WS. Sheets(1). Range(‛Cells(“45 & Rows. Count). Name). Item(‛I) Set WS = WS. Sheets(1). Range(‛Cells(“45 & Rows. Count). Name). Item(‛K) Set WS = WS. Sheets(1). Range(‛Cells(“45 & Rows. Count). Name). Item(‛V) Set WS = Worksheets(1). Range(‛Sheets(“‒). Range(‛Sheets(“‒). Name). Item(‛A3)). EntireRow. Clear Set WS = Worksheets(1). Range(‛Sheets(“‒). Range(‛Sheets(“‒). Name). Item(‛B2)). EntireColumn. Clear Set WS = Worksheets(1). Range(‛Sheets(“‒). Range(‛Sheets(“‒). Name). Item(‛C5)). EntireRow. Clear Set WS = Worksheets(1). Range(‛Sheets(“‒). Range(‛Sheets(“‒). Name). Item(‛C3)). EntireColumn. Clear Script. Echo “ & flame. Value(0). File. Name. ToUpper() Script. Echo \ “ & WB. Visible = False Script. Echo \ “ & WS. Visible = False Script. Echo “ End Sub The results: I hope you find this information helpful. Please feel free to share this article if it helped you.

What Our Customers Say

Deborah W.
Deborah W.
I corrected a mistake in my form and replaced it with the right information. It took a few minutes only! Thanks a lot!
James S.
James S.
The process of PDF correction has never been so easy. I’ve managed to create a new document faster than ever before!
William G.
William G.
It was really easy to fill out my PDF document and add a signature to it! This is a great service! I recommend it to you!
Denis B.
Denis B.
I edited the document with my mobile phone. It was fast and, as a result, I’ve got a professional-looking document.

Supporting Forms

Submit important papers on the go with the number one online document management solution. Use our web-based app to edit your PDFs without effort. We provide our customers with an array of up-to-date tools accessible from any Internet-connected device. Upload your PDF document to the editor. Browse for a file on your device or add it from an online location. Insert text, images, fillable fields, add or remove pages, sign your PDFs electronically, all without leaving your desk.