Te mando toda la macro, funciona para diferentes drives C: D: E: etc.
'*******Macro******
Sub listar_archivos()
'Por.Dam
'Lee archivos de un directorio y los copia en un destino
On Error Resume Next
Dim archori, archdes As String
'carpetaorigen = "C:\Documents and Settings\DAMOR\Mis documentos\docs\Soporte expertos\archivos\"
'carpetadestino = "E:\equipos\"
carpetaorigen = "C:\Pendientes\"
carpetadestino = "E:\equipos\"
'lee archivos del origen
ChDrive Left(carpetaorigen, 1)
ChDir carpetaorigen
archi = Dir("*.*")
Workbooks("copiaarchivos").Activate
Range("A:E").Clear
Range("A1").Select
Do While archi <> ""
ActiveCell.Value = archi
ActiveCell.Offset(1, 0).Select
archi = Dir()
Loop
'lee las carpetas destino
ChDrive Left(carpetadestino, 1)
ChDir carpetadestino
carpe = Dir("*", vbDirectory)
Range("B1").Select
Do While carpe <> ""
If carpe <> "." And carpe <> ".." Then
ActiveCell.Value = carpe
ActiveCell.Offset(1, 0).Select
End If
carpe = Dir()
Loop
ufila = Range("A" & Rows.Count).End(xlUp).Row
ufilacarpetas = Range("B" & Rows.Count).End(xlUp).Row
Range("A1").Select
lin = 1
Do While lin <= ufila
archori = carpetaorigen & Cells(lin, 1).Value
celda = Cells(lin, 1).Value
escuatro = InStr(1, celda, "-")
If escuatro = 5 Then
numarchivo = Left(Cells(lin, 1).Value, 4)
Else
If escuatro = 6 Then
numarchivo = Left(Cells(lin, 1).Value, 5)
End If
End If
'busca numero archivo en el numero de carpeta
lincarpetas = 1
nomcarpeta = ""
Do While lincarpetas <= ufilacarpetas
If escuatro = 5 Then
nummasguion = numarchivo & "-"
If nummasguion = Left(Cells(lincarpetas, 2).Value, 5) Then
nomcarpeta = Cells(lincarpetas, 2).Value
Exit Do
End If
Else
If escuatro = 6 Then
'numarchivo = Left(Cells(lin, 1).Value, 5)
nummasguion = numarchivo & "-"
If nummasguion = Left(Cells(lincarpetas, 2).Value, 6) Then
nomcarpeta = Cells(lincarpetas, 2).Value
Exit Do
End If
End If
End If
lincarpetas = lincarpetas + 1
nomcarpeta = ""
Loop
If nomcarpeta = "" Then
'La carpeta destino no existe
Cells(lin, 3).Value = ("La carpeta destino no existe")
Cells(lin, 4).Value = archori
Cells(lin, 5).Value = archdes
Else
archdes = carpetadestino & nomcarpeta & "\" & Cells(lin, 1).Value
FileCopy archori, archdes
If Err.Number = 0 Then
'El archivo fue copiado
Cells(lin, 3).Value = ("Copiado")
Else
Cells(lin, 3).Value = ("Copia con Error " & Err.Number)
Err.Number = 0
Cells(lin, 4).Value = archori
Cells(lin, 5).Value = archdes
End If
End If
lin = lin + 1
Loop
End Sub
'******Macro******* Saludos.dam