Hello,
If any of you awesome people could help, it would be much appreciated,
Right, I have used record macro to print a workbook and save in both .xlsm and .pdf and then return to the Input Screen, but I cannot work out how to rename the saved file according to the data in a cell,
I have 2 sheets in the workbook, one called Input Screen and one called Incident Report,
I would like to use cell A12 from the Incident Report sheet as the name.
The VBA coding I am using for the print and save is as follows,
Sub saveprint()
'
' saveprint Macro
'
'
Sheets("Incident Report").Select
ActiveWorkbook.SaveAs Filename:="C:\Users\wornhams\Desktop\NewReport.xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\wornhams\Desktop\NewReport.pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Input Screen").Select
End Sub
Any help would be much appreciated,
Thanks Stef
If any of you awesome people could help, it would be much appreciated,
Right, I have used record macro to print a workbook and save in both .xlsm and .pdf and then return to the Input Screen, but I cannot work out how to rename the saved file according to the data in a cell,
I have 2 sheets in the workbook, one called Input Screen and one called Incident Report,
I would like to use cell A12 from the Incident Report sheet as the name.
The VBA coding I am using for the print and save is as follows,
Sub saveprint()
'
' saveprint Macro
'
'
Sheets("Incident Report").Select
ActiveWorkbook.SaveAs Filename:="C:\Users\wornhams\Desktop\NewReport.xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\wornhams\Desktop\NewReport.pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Input Screen").Select
End Sub
Any help would be much appreciated,
Thanks Stef