Hi,
I have tried writing this code with the help of my friend.
Sub copyPNGfiles()
Dim fso As Scripting.FileSystemObject
Dim fldFrom As Scripting.Folder, fldTo As Scripting.Folder
Dim file As Scripting.file
Set fso = New FileSystemObject
Set fldFrom = fso.GetFolder("P:\Report\ABCD_1")
Set fldTo = fso.GetFolder("P:\Report\ABCD_2")
For Each file In fldFrom.Files
If Right(file.Name, 4) = ".png" Then
file.Copy fldTo.Path & "\" & file.Name, True
End If
Next file
End Sub
But problem with this code is it copies all images from source folder to the destination folder. What we need is, we want to copy only those images which are mentioned in column B.
we are not able to link the code with that excel file.
Any help would be highly appreciated.
Thanks
|