Option
Explicit
Public
Sub
not_tested()
Dim
objFSO
As
Object
Dim
objFolder
As
Object
Dim
objFile
As
Object
Dim
objCell
As
Range
Dim
strSourcePath
As
String
, strDestinationPath
As
String
strSourcePath =
"C:\Bestellungen"
strDestinationPath =
"C:\Versand"
Set
objFSO = CreateObject(
Class
:=
"Scripting.FileSystemObject"
)
Set
objFolder = objFSO.GetFolder(strSourcePath)
For
Each
objFile
In
objFolder.Files
For
Each
objCell
In
Tabelle1.Columns(12)
With
objFile
If
objCell.Value = vbNullString
Then
Exit
For
ElseIf
.Name
Like
"*"
& objCell.Value &
"*"
Then
Name strSourcePath &
"\" & .Name As strDestinationPath & "
\" & .Name
End
If
End
With
Next
Next
Set
objCell =
Nothing
Set
objFolder =
Nothing
Set
objFSO =
Nothing
End
Sub