matttclark
Board Regular
- Joined
- Jan 13, 2011
- Messages
- 100
I regularly receive a bunch of database generated report files in a directory. Every report is named similarly using a text name telling the generic type with a date/time stamp afterwards. For instance one series might be "Production Report 20110713141955". Every report in that series will be "Production Report <date/time>" so no two are named exactly the same.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Each separate file is a report for a different department. I have not been able to get the database folks to include the department name in the report title so I need to manually rename all of them. They are always in the same sequence, by that I mean the first date-timed report is always Department A17, the second date-time is always Department A18, etc. The date and time stamps are of course always different so I cannot use a fixed renaming macro.<o></o>
<o></o>
Is there a way using VBA to rename all files in a directory by going in sequence through the files in the directory, and renaming those against a list in excel until all are done?<o></o>
<o></o>
Thanks!<o></o>
matt
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Each separate file is a report for a different department. I have not been able to get the database folks to include the department name in the report title so I need to manually rename all of them. They are always in the same sequence, by that I mean the first date-timed report is always Department A17, the second date-time is always Department A18, etc. The date and time stamps are of course always different so I cannot use a fixed renaming macro.<o></o>
<o></o>
Is there a way using VBA to rename all files in a directory by going in sequence through the files in the directory, and renaming those against a list in excel until all are done?<o></o>
<o></o>
Thanks!<o></o>
matt