Link to home
Start Free TrialLog in
Avatar of Seamus2626
Seamus2626Flag for Ireland

asked on

Save File with date suffix

Below I have some code to save a file in a location -

I would like to add to this code a date suffix

So it will save as France Everything - 16 Dec

Can someone amend

Thanks



Sub SaveTheFile_Everything()

'This code saves the file that has been manipulated with the affix "Manipulated"
'This means, for audit and cross checking purposes, we have the original file and the
'manipulated file



    FileYear = Year(Date)

    MonthOffset = 0
If Day(Date) = 1 Then MonthOffset = 1
    FileMonth = Month(Date) - MonthOffset
    FileDate = Format(Date, "mmm yy")
    FilePath = "R:\SPM\CAO\FRA\" & FileYear & "\" & FileDate & "\France Everything.xlsx"

    ActiveWorkbook.SaveAs Filename:=FilePath

    ActiveWorkbook.Close



End Sub
ASKER CERTIFIED SOLUTION
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Seamus2626

ASKER

Thanks Rob!