Hallo,
dann versuchs nochmal hiermit....
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
With Workbooks("TwsActiveX.xls").Worksheets("Executions")
For Each objCell In .Range(.Cells(11, 12), .Cells(100, 12))
With objFile
If objCell.Value = vbNullString Then
Exit For
ElseIf .Name Like "*" & objCell.Value & "*" And objCell.Offset(0, 5).Value = "SLD" Then
Name strSourcePath & "\" & .Name As strDestinationPath & "\" & .Name
End If
End With
Next
End With
Next
Set objCell = Nothing
Set objFolder = Nothing
Set objFSO = Nothing
End Sub
Gruß,
|