![]() |
Printing to Acrobat - Possible to use VBA to program PDF file name
I have a Home sheet that has a series of names
Example: A11 = c:\PDFFiles\Sheet1.pdf A12 = c:\PDFFiles\Sheet2.pdf You can use formulas for create names. I have the vba sub linked to a button on Home Sheet. Sub CreatePFF() Sheets("Sheet1").Select Range("a1").Select Dim PDFFilename As String Let PDFFilename = Sheets("Home").Range("a11") ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=PDFFilename, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False Let PDFFilename = Sheets("Home").Range("a12") ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=PDFFilename, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False Range("a1").Select Sheets("Home").Select Range("b5").Select End Sub "Tom Joseph" wrote: I would like to automate creation of a series of PDFs. Each from a print range on a different Excel sheet. I would like the PDF file names to be taken from a series of cells in Excel. eg PDF 1 would be called "20090129_ED-IPSTAT-ONC.pdf". This string would be stored in Cell A1. PDF 2 would be called "20090129_PerformanceSummary.pdf". This string would be stored in Cell A2. and so on. Any help would be greatly appreciated. |
Printing to Acrobat - Possible to use VBA to program PDF file
Sorry this posted before I was done
I have a Home sheet that has a series of names Print setup is done in each sheet based on the reports Clicking the button will create all 20 reports and place them in the folder on my C Drive on I can change it to a folder on the Server. Example: A11 = c:\PDFFiles\Sheet1.pdf A12 = c:\PDFFiles\Sheet2.pdf I have 20 names for reports listed You can use formulas for create names. I have the vba sub linked to a button on Home Sheet. Sub CreatePDF() Sheets("Sheet1").Select Range("a1").Select Dim PDFFilename As String Let PDFFilename = Sheets("Home").Range("a11") ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=PDFFilename, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False Sheets("Sheet2").Select Range("a1").Select Let PDFFilename = Sheets("Home").Range("a12") ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=PDFFilename, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False Sheets("Home").Select Range("a1").Select End Sub "Mark" wrote: I have a Home sheet that has a series of names Example: A11 = c:\PDFFiles\Sheet1.pdf A12 = c:\PDFFiles\Sheet2.pdf You can use formulas for create names. I have the vba sub linked to a button on Home Sheet. Sub CreatePFF() Sheets("Sheet1").Select Range("a1").Select Dim PDFFilename As String Let PDFFilename = Sheets("Home").Range("a11") ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=PDFFilename, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False Let PDFFilename = Sheets("Home").Range("a12") ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=PDFFilename, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False Range("a1").Select Sheets("Home").Select Range("b5").Select End Sub "Tom Joseph" wrote: I would like to automate creation of a series of PDFs. Each from a print range on a different Excel sheet. I would like the PDF file names to be taken from a series of cells in Excel. eg PDF 1 would be called "20090129_ED-IPSTAT-ONC.pdf". This string would be stored in Cell A1. PDF 2 would be called "20090129_PerformanceSummary.pdf". This string would be stored in Cell A2. and so on. Any help would be greatly appreciated. |
All times are GMT +1. The time now is 01:41 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com