Hello,
I have a code that works well for saving to multiple locations. However, I would like for the code to check for existing files in BOTH locations and if one exist then to save under sme name with different version. i.e testfilev1. Hope I explained that right.
thank you very much
___________________________________________________________________________________
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If MsgBox("Would you like to back up file?", vbYesNo) = vbYes Then _
Dim newFile As String, fName As String
' Don't use "/" in date, invalid syntax
fName = Sheets("Service Objective").Range("AH1").Value
'Change the date format to whatever you'd like, but make sure it's in quotes
newFile = fName & " " & Format$(Date, "mmmm-yyyy")
' Change directory to suit your PC, including USER NAME
ChDir _
"S:\Active Individual Programs\Manager folder\service objectives\"
ActiveWorkbook.SaveAs Filename:=newFile
ActiveWorkbook.SaveAs "S:\Active Individual Programs\All Individual SAP Programs\1 Master template\2015\Data\" + ActiveWorkbook.Name
End If
End Sub
I have a code that works well for saving to multiple locations. However, I would like for the code to check for existing files in BOTH locations and if one exist then to save under sme name with different version. i.e testfilev1. Hope I explained that right.
thank you very much
___________________________________________________________________________________
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If MsgBox("Would you like to back up file?", vbYesNo) = vbYes Then _
Dim newFile As String, fName As String
' Don't use "/" in date, invalid syntax
fName = Sheets("Service Objective").Range("AH1").Value
'Change the date format to whatever you'd like, but make sure it's in quotes
newFile = fName & " " & Format$(Date, "mmmm-yyyy")
' Change directory to suit your PC, including USER NAME
ChDir _
"S:\Active Individual Programs\Manager folder\service objectives\"
ActiveWorkbook.SaveAs Filename:=newFile
ActiveWorkbook.SaveAs "S:\Active Individual Programs\All Individual SAP Programs\1 Master template\2015\Data\" + ActiveWorkbook.Name
End If
End Sub