Forum Discussion
krishank652
Jun 17, 2021Copper Contributor
How do I copy some multiple photos from one folder to another?
I have a list of names of photos that I have required to copy from one folder to another. How Can I do that? List of Photos name that I have required to copy in a New Folder:- qa List of ...
amol bhosale
Copper Contributor
HansVogelaar
May 11, 2022MVP
Try this macro:
Sub CopyFiles()
' Folder containing the images. Path must end in \
Const SourcePath = "C:\MyFiles\Source\"
' Folder to copy the images to. Path must also end in \
Const TargetPath = "C:\MyFiles\Target\"
Dim r As Long
Dim LastRow As Long
LastRow = Range("A" & Rows.Count).End(xlUp).Row
For r = 1 To LastRow
FileCopy SourcePath & Range("A" & r).Value, TargetPath & Range("A" & r).Value
Next r
End Sub
- HansVogelaarSep 14, 2022MVP
I don't think the code has anything to do with that.
Have you contacted your IT department?
- AryanVerma1988Sep 14, 2022Copper Contributor
your codding are working but some error is showing when we open the file.
can you check why this error are coming
Thanks