FashionGal
New Member
- Joined
- Mar 24, 2019
- Messages
- 5
Hello All,
I am new to macros and so I need a bit of help. I am trying to save an excel file to PDF using a macro and I want to change the file name to be based off of a particular cell. I have gotten the macro to save the file, however it asks me to name the file. Is there a way to make it automatically save to the folder I listed in the macro and use a particular cell value to automatically name the file. I also do not want the PDF to automatically open once it has been created. Any help would be greatly appreciated.
Here is the macro I currently have:
Sub PTPDF()
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Dim pdfName As String, FolderName As String, FullName As String
pdfName = Sheets("Award Sheet").Range("CXID").Text
FullName = "I:\Student Awarding\2019-20\APPEALS + pdfName & .pdf"
ActiveSheet.Shapes.Range(Array("Button 2744")).Select
Selection.OnAction = "PTPDF"
Range("V17").Select
Application.WindowState = xlNormal
End Sub
I am new to macros and so I need a bit of help. I am trying to save an excel file to PDF using a macro and I want to change the file name to be based off of a particular cell. I have gotten the macro to save the file, however it asks me to name the file. Is there a way to make it automatically save to the folder I listed in the macro and use a particular cell value to automatically name the file. I also do not want the PDF to automatically open once it has been created. Any help would be greatly appreciated.
Here is the macro I currently have:
Sub PTPDF()
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Dim pdfName As String, FolderName As String, FullName As String
pdfName = Sheets("Award Sheet").Range("CXID").Text
FullName = "I:\Student Awarding\2019-20\APPEALS + pdfName & .pdf"
ActiveSheet.Shapes.Range(Array("Button 2744")).Select
Selection.OnAction = "PTPDF"
Range("V17").Select
Application.WindowState = xlNormal
End Sub