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:-
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
Monday, May 23, 2011
Rename Folders In Excel VBA
Subscribe to: Post Comments (Atom)
Import data from SQL
Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...
If you want to add a new menu on mouse right click "Workbook Navigation showing you the list of all open workbooks and worksheets in ea...
Macro to Export Range in Json Format Option Explicit Sub export_in_json_format() Dim fs As Object Dim jsonfile Dim rangetoex...
Here i got a error message as file not found...ReplyDelete
Anything i missed to follow... Please help me
@ganesh check your inboxReplyDelete
Thanks for the post. How would I change the names for shortcuts to folders?ReplyDelete
I got the same error message as "File not found".
Could you please help.