Forum Discussion
How do I copy some multiple photos from one folder to another?
Please read this link before continuing
Welcome to your Excel discussion space!
How are you sure that what was written or copied in the Excel sheet also exists in the folder?
Here is a suggested solution with direct copying from folder to folder.
Option Explicit
Sub Copy()
Dim rngC As Range
Const cstrPfad1 As String = "c:\Bilder\"
Const cstrPfad2 As String = "c:\Bilder\relevant\"
If Dir(cstrPfad2, vbDirectory) = "" Then
MkDir cstrPfad2
End If
For Each rngC In Range(Cells(2, 1), Cells(Rows.Count, 1).End(xlUp))
Name cstrPfad1 & rngC As cstrPfad2 & rngC
Next
End Sub
- krishank652Jun 17, 2021Copper Contributor
I am using OS: Windows10 and Product: Microsoft office professional plus 2016
Yes, photos exist in the folder and their names exist in the excel sheet.
I run this code in Macro. It's showing an error
- NikolinoDEJun 17, 2021Gold Contributor
As ordered 🙂
You have to specify the path in the code and the name of the new folder where you want to go.
Easy to do.
It worked for me without any problems (test under Excel 2016 and Windows 10, as desired).
I wish you a lot of fun with Excel.
I would be happy to know if I could help.
Nikolino
I know I don't know anything (Socrates)
- amol bhosaleMay 11, 2022Copper Contributor