Sub copy_data()
Dim FSO As Object
Dim FromPath As String
Dim ToPath As String
Dim Fdate As Date
Dim FileInFromFolder As Object
Dim aBool As Boolean
aBool = False
FromPath = ThisWorkbook.Path & "\01\" 'Source files
ToPath = ThisWorkbook.Path & "\02\" 'Target destination
Set FSO = CreateObject("scripting.filesystemobject")
If FSO.FolderExists(FromPath) = False Then aBool = True
If FSO.FolderExists(ToPath) = False Then aBool = True
If FSO.FolderExists(ToPath & "\B\") = False Then aBool = True
If FSO.FolderExists(ToPath & "\C\") = False Then aBool = True
If FSO.FolderExists(ToPath & "\D\") = False Then aBool = True
If aBool Then
MsgBox "folders doesn't exist"
Exit Sub
End If
For Each FileInFromFolder In FSO.getfolder(FromPath).Files
If Left(FileInFromFolder.Name, 1) = "0" Then FileInFromFolder.Copy ToPath & "\B\"
If Left(FileInFromFolder.Name, 1) = "1" Then FileInFromFolder.Copy ToPath & "\C\"
If Left(FileInFromFolder.Name, 1) = "3" Then FileInFromFolder.Copy ToPath & "\D\"
Next
End Subcitovat