Macro to Save File as PDF based on Cell Conte

Microsoft Microsoft excel 2007 (pc)
June 17, 2010 at 04:20:02
Specs: Windows XP
Macro to Save File as PDF based on Cell Contents.
I am looking for a macro that when I click on a button, the workbook is saved as a PDF file and automatically named based on cell content. Excel 2007

See More: Macro to Save File as PDF based on Cell Conte

Report •

June 17, 2010 at 16:50:40
You should be able to do that with the following:

Sub pdfsave()

pdfname = Range("A1").Value

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=pdfname, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
End Sub

Change the line "pdfname = Range("A1").Value" to reflect the cell with the file name.

Report •

June 18, 2010 at 02:46:25
Hi Viddywell, Thanks for your help, That works well, but one thing I didn't explain very well is that I want to save it straight to a specific folder on my computer. for example c:\my documents/PDF.
Also, do you you if it is possible to save the document as a PDF and at the same time as an excel file in the same macro?

Report •

Related Solutions

Ask Question