How To Create PDF Online?
Easy-to-use PDF software
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
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
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.