ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Rename a group of files using an Excel spreadsheet (https://www.excelbanter.com/excel-programming/408832-rename-group-files-using-excel-spreadsheet.html)

Rich

Rename a group of files using an Excel spreadsheet
 
Is there a way to do automate the renaming of a large number of files from a
spreadsheet that contains the old and new data?

Thanks!

-Rich

Bob Umlas, Excel MVP

Rename a group of files using an Excel spreadsheet
 
Look at the VBA Name function:
Name "oldname.xls" as "newname.xls"

"Rich" wrote:

Is there a way to do automate the renaming of a large number of files from a
spreadsheet that contains the old and new data?

Thanks!

-Rich


Ivyleaf

Rename a group of files using an Excel spreadsheet
 
On Apr 5, 1:02*am, Rich wrote:
Is there a way to do automate the renaming of a large number of files from a
spreadsheet that contains the old and new data?

Thanks!

-Rich


Hi Rich,

Two ways that I can think of.

The first would involve writing code, the second though is probably
easier.

Assuming you have the old filenames in Col A and new ones in Col B:

1. Insert another col at the start, so that col A is empty.
2. Fill Col A with "ren" for as many rows as you have.
3. Go File - Save As and select the "Formatted Text (Space delimited)
(*.prn)" format.
4. Type the file name (anything will do) and hit Save.
5. Move the file to the directory that has the files in that you want
to rename (unless you had paths in the names as well in which case it
doesn't matter).
6. Change the extension on your new file to ".bat"
7. Double click it.

Cheers,
Ivan.


Rich

Rename a group of files using an Excel spreadsheet
 
Doh! I should have thought of that! So easy! Thanks much! Worked like a
charm.
-Rich

"Ivyleaf" wrote:

On Apr 5, 1:02 am, Rich wrote:
Is there a way to do automate the renaming of a large number of files from a
spreadsheet that contains the old and new data?

Thanks!

-Rich


Hi Rich,

Two ways that I can think of.

The first would involve writing code, the second though is probably
easier.

Assuming you have the old filenames in Col A and new ones in Col B:

1. Insert another col at the start, so that col A is empty.
2. Fill Col A with "ren" for as many rows as you have.
3. Go File - Save As and select the "Formatted Text (Space delimited)
(*.prn)" format.
4. Type the file name (anything will do) and hit Save.
5. Move the file to the directory that has the files in that you want
to rename (unless you had paths in the names as well in which case it
doesn't matter).
6. Change the extension on your new file to ".bat"
7. Double click it.

Cheers,
Ivan.




All times are GMT +1. The time now is 07:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com