Hi all,
In sub which will convert file to PDF and save it to assigned folder and then attach it to email in outlook.
All works fine.
However is is possible to modify the code to save fole to respective month folder ( as per current date and year)??
e.g.
I have created folder Named 'Trial' in C drive .
This has sub folders 2014, 2015, 2016, 2017, 2018
Each year folder will have sub-sub folders month wise like
This has sub folders as Jan , Feb , Mar , Apr .... till Dec
Now e.g.
if date when the pdf was created is 23/4/14 then it is saved in C:\Trials\2014\Apr automatically.
Currently every year I keep creating new folders etc... bit primitive though.
Part code is as follows and I request help please.
Kind regards
fPATH = "C:\Trials\"
With ActiveSheet
fNAME = Format(.[F9], "YYMMDD") & "-" & .[D9] & "-" & .[E9] & "-" & .[G9] & .[G11] & "-" & "-" & Format(.[F9], "DDMMYY") & ".pdf"
.Range("C6:H43").ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=fPATH & fNAME, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
End With
Bookmarks