Suppose you want to rename folders in one go
For example snapshot below-

All you need to get list of folders with complete path and folder name in COL A and COL B and type the new names in COL C Then run the macro
Here is the code:-
Sub rename_folder()
Dim old_name, new_name As String
For i = 2 To Sheets(1).Range("a1").End(xlDown).Row
new_name = Left(Sheets(1).Cells(i, 1).Value, Len(Sheets(1).Cells(i, 1).Value) - Len(Sheets(1).Cells(i, 2).Value))
new_name = new_name & Sheets(1).Cells(i, 3).Value
old_name = Sheets(1).Cells(i, 1).Value
Name old_name As new_name
Next i
End Sub
Here i got a error message as file not found...
ReplyDeleteAnything i missed to follow... Please help me
@ganesh check your inbox
ReplyDeleteThanks for the post. How would I change the names for shortcuts to folders?
ReplyDeleteThanks
Hi
ReplyDeleteI got the same error message as "File not found".
Could you please help.