As WGM suggests, you should post the code rather than a pdf or image. Just copy and paste and apply the code tags.
Code:
Do While loop V 290423:---------------------------
Dim Filename As String
Dim parth As String
Dim dymy As String
Dim Dest As String
Dest = "D:\Data\BBO\Test"
parth = "D:\Data\BBO"
Filename = Dir(parth)
Do While Len(Filename) > 0
dymy = Mid(Filename, 1, 4)
If dymy = Format(Now(), "mmdd") Then
MsgBox " This is the File " & dymy
'need file copy function here
End If
MsgBox [dymy]
Filename = Dir
Loop
End Sub
If there is only one file and you know the name then use fso
Code:
Sub CopyMyFile(SourceFile As String, Destination As String)
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(SourceFile) Then
' fso.CopyFile SourceFile, Destination 'if you want to copy to new location
fso.MoveFile SourceFile, Destination 'if you want to move to new location
else
Msgbox "File Doesn't Exist"
End If
Set fso = Nothing
End Sub
In your loop you could use the Name() https://learn.microsoft.com/en-us/of...name-statement