jmcginley3
New Member
- Joined
- Mar 28, 2018
- Messages
- 14
On a weekly basis I receive 20-30 files and they all have to be renamed to a specific format so our automated system will pick them up and send them where they need to go.
I made a spreadsheet with a very simple macro that pulls in the files from the specified folder and places all the file names in column A (file names start in A2). Then in column B I can type in how each corresponding file from column A should be renamed. Then I have a macro that just renames A2 to whatever I have in B2, A3 to B3, etc etc.
To take it a step further, about 80% of the files I receive are going to be named the same when I get them so I figured I could use a macro or formula to look for these files and automatically rename them. Here's some examples of what I mean:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Old File Name[/TD]
[TD]New File Name[/TD]
[/TR]
[TR]
[TD]PLAN_PAY_BY_PRODUCT_351NE4737Y[/TD]
[TD]PlanPayByProductCode_MMDDYYYY[/TD]
[/TR]
[TR]
[TD]DAILY_CHECKEFT_REISSUES_3YNE8FH34[/TD]
[TD]Daily_check_eft_reissues_MMDDYYY[/TD]
[/TR]
[TR]
[TD]DETAIL_GROUP_ACTIVITY_1_58J859H[/TD]
[TD]GroupActivityDetail_MMDDYYY[/TD]
[/TR]
</tbody>[/TABLE]
In the Old File Name column there are generally around 30 different files and they are never in the same order.
If I can look in all of column A for PLAN_PAY_BY_PRODUCT* (because that last code after the final underscore always changes on every file) and then have it automatically enter PlanPayByProductCode_MMDDYYYY (with the current month, day, year) in the cell directly adjacent in column B then it would cut down even more time renaming these files every day. I'd need to do that for every file name that can automatically be changed.
Any idea on how to best handle this? Thanks in advance!
I made a spreadsheet with a very simple macro that pulls in the files from the specified folder and places all the file names in column A (file names start in A2). Then in column B I can type in how each corresponding file from column A should be renamed. Then I have a macro that just renames A2 to whatever I have in B2, A3 to B3, etc etc.
To take it a step further, about 80% of the files I receive are going to be named the same when I get them so I figured I could use a macro or formula to look for these files and automatically rename them. Here's some examples of what I mean:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Old File Name[/TD]
[TD]New File Name[/TD]
[/TR]
[TR]
[TD]PLAN_PAY_BY_PRODUCT_351NE4737Y[/TD]
[TD]PlanPayByProductCode_MMDDYYYY[/TD]
[/TR]
[TR]
[TD]DAILY_CHECKEFT_REISSUES_3YNE8FH34[/TD]
[TD]Daily_check_eft_reissues_MMDDYYY[/TD]
[/TR]
[TR]
[TD]DETAIL_GROUP_ACTIVITY_1_58J859H[/TD]
[TD]GroupActivityDetail_MMDDYYY[/TD]
[/TR]
</tbody>[/TABLE]
In the Old File Name column there are generally around 30 different files and they are never in the same order.
If I can look in all of column A for PLAN_PAY_BY_PRODUCT* (because that last code after the final underscore always changes on every file) and then have it automatically enter PlanPayByProductCode_MMDDYYYY (with the current month, day, year) in the cell directly adjacent in column B then it would cut down even more time renaming these files every day. I'd need to do that for every file name that can automatically be changed.
Any idea on how to best handle this? Thanks in advance!