Hi,
Is it possible to change folder names with VBA, I have 600+ to change
I want to add a prefix to the current name
Thanks
Kevin
Hi,
Is it possible to change folder names with VBA, I have 600+ to change
I want to add a prefix to the current name
Thanks
Kevin
Last edited by Excelski; 11-01-2019 at 03:24 AM. Reason: more descriptive title
Yes, it's possible. This came up first in a Google search: https://stackoverflow.com/questions/...older-renaming
This might also help: https://www.howtoexcel.org/vba/how-t...s-from-a-list/
Last edited by AliGW; 11-01-2019 at 02:54 AM.
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
Forum Rules (updated August 2023): please read them here.
Thank you Ali, I will try it.
I did google it first but didn't see that!
What did you Google??? I simply typed "VBA change folder names".
I failed to mention VBA!
That said, I think this is above my sill level.
I was hoping to be able to list the old and new folder names in excel and pint at the location...….wishful thinking
You could look here: http://www.vbforums.com/showthread.p...ough-excel-vba
Google search: "VBA change folder names from list excel".
I suggest you update this thread's title to include the list requirement. Also, explain more about the change that you want to make - is it a prefix you wish to add or change? Are the folders in question all within one directory?
Last edited by AliGW; 11-01-2019 at 03:17 AM.
Thanks again.
How do I update title?
Edit your opening post and change it.
Title changed
That's better - let's see what the VBA experts say. In the meantime, provide the following:
1. Examples of folder names that you want to change, e.g. from XYZ-folder to ABC-folder.
2. Where the folders are (directory, e.g. C:\Users\Exelski\Documents\Stuff).
Okay Thanks
Currently the folder names are descriptions of physical locations, eg 3rd floor east elevation. I want to prefix all folders with KJC 001, KJC 002 etc. The example becomes KJC 001 3rd floor east elevation
Directory is C:\Users\kevin.xxxx\Documents\Locations\
Let's start with this.
The code extracts all foldernames from basefldr and lists them in Column A.
It then adds the prefix to the foldernames (Column B)
After that it starts renaming all foldernames according to names in Column B.
Try this first on a directory with only a few folders in it to test.Please Login or Register to view this content.
Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.
Hi barkerman,
It worked like a charm
Thank you!!
Kevin
you're welcome and thanks for rep+.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks