H o l a:
Te anexo la macro. En la columna C te va a poner un mensaje.
Si tienes más archivos con más extensiones, agrega el nombre de la extensión en esta línea de la macro:
exts = "JPG, PNG, JPEG, GIF"
Pon la macro en tu archivo de excel y guarda el archivo en la misma carpeta donde tienes los archivos a renombrar.
Sub RenombrarArchivos()
'Por.Dante Amor
ruta = ThisWorkbook.Path & "\"
exts = "JPG, PNG, JPEG, GIF"
For i = 1 To Range("A" & Rows.Count).End(xlUp).Row
If Cells(i, "A") <> "" Then
If Cells(i, "B") <> "" Then
arch1 = Dir(ruta & Cells(i, "A") & ".*")
p = InStrRev(arch1, ".")
ext = Mid(arch1, p + 1)
arch2 = Cells(i, "B") & "." & ext
'
If arch1 <> "" Then
Do While arch1 <> ""
If InStr(1, exts, UCase(ext)) > 0 Then
Name ruta & arch1 As ruta & arch2
Cells(i, "C") = "Archivo renombrado"
Exit Do
End If
Loop
Else
Cells(i, "C") = "Archivo NO existe"
End If
Else
Cells(i, "C") = "Falta Archivo en columna B"
End If
Else
Cells(i, "C") = "Falta Archivo en columna A"
End If
Next
MsgBox "fin"
End Sub
':)
'S aludos. D a n t e A m o r . R ecuerda valorar la respuesta. G racias
':)