PDA

View Full Version : [SOLVED] Select Folder and Rename Files according to list in excel using VBA



mediocrereco
07-23-2018, 01:23 AM
Hello vba gurus. I have a list of names in an excel file in Column A. I have a group of folders with files in them. I want the files to be renamed according to the list in Column A. The next folder will begin when the names have "break" in the row.
Please find below an example.
In the below scenario, I will have 3 folders.
Folder 1 will have 3 files, Folder 2 will have 5 files and Folder will have 5 files.
The files will have random names and the folders and files will be sorted by name.
I want the code to read column A and ask me to select folder. It should then rename the files in the folder that I have selected according to column A.
When it reads "break", it should ask me to select folder again. It should then read the names and rename the files in that folder accordingly.
When it reads break again, it should ask me to select folder and so on.
The number of names in the excel file and the corresponding files will always be same. the code should only change the name of the file, the extension should remain the same.
Appreciate your kind help.

Column A
Hello
world
How
break
are
you
wassup
good
bye
break
tomorrow
is
a
new
day

I apologize if I have made an error in not following the posting rules. I am quite new to vba and to this forum so please excuse my noon-ness.

mancubus
07-25-2018, 06:02 AM
welcome to the forum.

post your workbook pls

clearly define the requirement
what are old file names and what will new file names be
how do we match old and new names.

etc, etc...