Renaming Files with Excel VBA Renaming Files with Excel VBA vba vba

Renaming Files with Excel VBA


I think you could do something like this, using the Name function to rename the files, however, you will probably need to make sure the 2 columns have the complete file path, i.e. "C:\Temp\ABC.jpg"

Dim Source As RangeDim OldFile As StringDim NewFile As StringSet Source = Cells(1, 1).CurrentRegionFor Row = 1 To Source.Rows.Count    OldFile = ActiveSheet.Cells(Row, 1)    NewFile = ActiveSheet.Cells(Row, 2)    ' rename files    Name OldFile As NewfileNext