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

Easy-to-use PDF software

review-platform review-platform review-platform review-platform review-platform

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

PDF documents can be cumbersome to edit, especially when you need to change the text or sign a form. However, working with PDFs is made beyond-easy and highly productive with the right tool.

How to Create PDF with minimal effort on your side:

  1. Add the document you want to edit — choose any convenient way to do so.
  2. Type, replace, or delete text anywhere in your PDF.
  3. Improve your text’s clarity by annotating it: add sticky notes, comments, or text blogs; black out or highlight the text.
  4. Add fillable fields (name, date, signature, formulas, etc.) to collect information or signatures from the receiving parties quickly.
  5. Assign each field to a specific recipient and set the filling order as you Create PDF.
  6. Prevent third parties from claiming credit for your document by adding a watermark.
  7. Password-protect your PDF with sensitive information.
  8. Notarize documents online or submit your reports.
  9. Save the completed document in any format you need.

The solution offers a vast space for experiments. Give it a try now and see for yourself. Create PDF with ease and take advantage of the whole suite of editing features.

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.