I found this formula on another forum, and it seems to suit what I need to do.
I have a folder full of files, and an excel sheet that has 2 columns containing the files names, and the other containing the names that the files should be.
As I understand it this is supposed to rename those files in column a, to the names in column b.
I don't understand this at all, but I get a runtime error 75. the path is correct as far as I know.
Ive put this code in the sheet, not the entire workbook.
Sub ReName()
Dim rFiles As Range, rCell As Range
Dim strNewName As String, strOld As String
Dim strPath As String
Dim wbOpen As Workbook
Application.ScreenUpdating = False
Set rFiles = Range("A1", Range("A65536").End(xlUp))
strPath = "K:\WebSites\96Cougar\flags"
For Each rCell In rFiles
Old = strPath & rCell
strNewName = strPath & rCell(1, 2)
Name strOld As strNewName
Next rCell
Application.ScreenUpdating = True
End Sub
Bookmarks