I'm so stuck but I know Im close. So its friday and I'm brain dead and I'm asking for some help please.
I have FILES starting with dates
140729HDF0.835
140730HES0.835
140731UHG0.835
and I need to move the files that are dated in the file's 2 days back.
Dim ObjFso
Dim SourceLocation
Dim DestinationLocation
Dim FileName
Set ObjFso = CreateObject("Scripting.FileSystemObject")
dteYesterday = DateAdd("d", -1, Date)
SourceLocation = "c:\835old"
DestinationLocation = "c:\835new"
FileName = (Year(dteYesterday), 2) & Right("0" & Month(dteYesterday), 2) & Right("0" & Day(dteYesterday), 2) & ".835"
ObjFso.MoveFile SourceLocation & "\" & FileName, DestinationLocation & "\"It's something in my FileName= because if I simply change it to
FileName = "*.835"its works. Can anyone help please??