Link to home
Start Free TrialLog in
Avatar of Adam_Li
Adam_LiFlag for Norway

asked on

Rename multiple files in folder from list in table/excel.

HI
I have a folder with images that i want to rename. I have a table with to columnd, one with current filenames and one with new filenames.  How can I rename those files?.. Command Batch? Excel Macro?
SOLUTION
Avatar of Bradley Fox
Bradley Fox
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
in excel vba, you can do something like this

Sub RenameFiles()
Dim strFolder As String
strFolder = "C:\Users\Documents\"
Sheet1.Activate
With Sheet1
    Name strFolder & .Cells(1, 1).Value As strFolder & .Cells(1, 2).Value
End With
End Sub

Open in new window

in C1 and copy down
="ren """ & A1 & """ """ & B1 & """"

Open in new window

  1. Copy whole column C to clipboard (CTRL+C) and go to CMD.exe
  2. CD to images folder and paste clipboard data (CTRL+V)
User generated image