Hi guys
Hope you all well and safe from Covid. while in lockdown im hoping someone can assist me with this query.
i had a macro created whereby image product code is listed in Column A, Column B lists the location of that particular image and Column C displays the location of where i want those images to be copied to. the code for that particular file is listed below. what i need help with if possible is can additional product images codes be listed in the exact same cell separated by ";". herewith the code of the original file
Sub copylistfile()
oldpath = Range("B2")
newpath = Range("C2")
LR = Cells(Rows.Count, "A").End(xlUp).Row
For r = 2 To LR
pc = Cells(r, 1)
fn = Dir(oldpath & pc & ".jpg")
If fn <> "" Then
FileCopy oldpath & pc & ".jpg", newpath & pc & ".jpg"
Cells(r, 4) = "copied"
Else
Cells(r, 4) = "missing"
Cells(r, 4).Interior.ColorIndex = 3
End If
Next
End Sub
Hope you all well and safe from Covid. while in lockdown im hoping someone can assist me with this query.
i had a macro created whereby image product code is listed in Column A, Column B lists the location of that particular image and Column C displays the location of where i want those images to be copied to. the code for that particular file is listed below. what i need help with if possible is can additional product images codes be listed in the exact same cell separated by ";". herewith the code of the original file
Sub copylistfile()
oldpath = Range("B2")
newpath = Range("C2")
LR = Cells(Rows.Count, "A").End(xlUp).Row
For r = 2 To LR
pc = Cells(r, 1)
fn = Dir(oldpath & pc & ".jpg")
If fn <> "" Then
FileCopy oldpath & pc & ".jpg", newpath & pc & ".jpg"
Cells(r, 4) = "copied"
Else
Cells(r, 4) = "missing"
Cells(r, 4).Interior.ColorIndex = 3
End If
Next
End Sub