Hi,
I’m trying to modify a section of VBA code which saves a file with today’s date at the end of the file name e.g. Myfilename (dd-mm-yyyy).xlxs
Whilst the code does work it populates the file as 'Myfilename 5-2-2018.xlxs' i.e. it drops the leading zero of the day (05) and leading zero of the month (02) instead of being 'Myfilename 05-02-2018.xlxs'
Can anyone please advise me how I would amend the section of VBA code below so it gives the dd-mm-yyyy format and also put brackets around the date so the file format would be 'Myfilename (dd-mm-yyyy).xlxs' e.g 'Myfilename (05-02-2018).xlxs'
tdate = Now()
report_date = Day(tdate) & "-" & Month(tdate) & "-" & Year(tdate)
Workbooks(wb_master).Activate
report_name = "Weekly WBS Report " & " " & report_date & ".xlsx"
SaveAsFileName = ActiveWorkbook.Path & "/" & report_name
Many thanks in advance for any assistance received
Regards
Rob
Bookmarks