Sub copylistfile_1()
Dim oldpath As String
Dim newpath As String
Dim LR As Long
Dim pc As Variant
Dim r As Long
Dim i As Long
Dim strResp As String
Dim fn As String
LR = Cells(Rows.Count, "A").End(xlUp).Row
If LR = 1 Then Exit Sub
For r = 2 To LR
oldpath = Cells(r, "B")
newpath = Cells(r, "C")
pc = Split(Cells(r, 1).Value, ";")
strResp = vbNullString
For i = 0 To UBound(pc)
fn = Dir(oldpath & pc(i) & ".jpg")
If fn <> "" Then
FileCopy oldpath & pc(i) & ".jpg", newpath & pc & ".jpg"
strResp = strResp & "C" & ";"
Else
strResp = strResp & "M" & ";"
End If
Next i
If Len(strResp) > 0 Then
strResp = Left(strResp, Len(strResp) - 1)
Cells(r, 4) = strResp
If InStr(1, strResp, "M", vbTextCompare) > 0 Then
Cells(r, 4).Interior.ColorIndex = 3
End If
End If
Next r
End Sub
where the letters in column D mean:
(C)opied; (M)issing
Artik