Quote:
Originally Posted by rollis13
Have you tried like this:
Code:
Option Explicit
Sub copyfiles()
Dim m As Variant
Dim FileName As String
Dim FileType As String
FileType = ".txt"
For m = 2 To 4
FileName = Cells(m, 1).Value
FileCopy "C:\Users\roberto.rodriguezram\Desktop\Source\" & FileName & FileType, _
"C:\Users\roberto.rodriguezram\Desktop\Destination\" & FileName & FileType
Next
End Sub
|
Thank you for the response. That worked perfectly!
I did only use it for a small sample (3 files)
But when I’m using it now for my actual list which is over 1000 names it is giving me an error which is a Run time error “53”.
I noticed the reason it’s giving me this error is because since my list is so long and there are some file names on my list that aren’t on a specific folder it is causing it to not just do the ones in the file that I need resulting in the crash. Is there a way to fix this issue?