Aah finally, after hours of tweaking and sleepless nights, here it occurs. Its so simple, that I feel embarrassed of not cracking it earlier
Sub Save()
Sheets(Array("Report", "Graphs")).Select
Sheets("Report").Activate
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="D:\Test\" & "Calculation ID= " & Range("D5").Value & " on " & Format(Now, "dd-mmm-yy") & " at " & Format(Time, "hh.mm.ss") & " " & Format(Time, "AMPM") & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=True, OpenAfterPublish:=True
Sheets("Report").Select
End Sub
Report and Graphs are sheet names
The final file in PDF format is save in folder D:\Test
Consider the value in cell D5 of sheet Report be 1234423, then
File is named as "Calculation ID= 1234423 on [Current Date] at [Current Time] AM/PM.pdf"
Bookmarks