• 0

Macro to Save File as PDF based on Cell Conte

  • 0

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

Sub pdfsave()

pdfname = Range(“A1”).Value

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

This works, but 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?