unknownymous
Board Regular
- Joined
- Sep 19, 2017
- Messages
- 249
- Office Version
- 2016
- Platform
- Windows
Hi Gurus,
Hope all is well.
Is it possible to rename a file based on it's equivalent cell value and criteria?
Scenario: I have different multiple files in a folder and in different file format
Sample filenames in a folder
0001 Datasheetxx.pdf
Dataaaaaasheetxx_002T.xlsx
Dataaa_0003_aaasheetxx.txt
0005 Dataaa__aaasheetxx.xls
What the macro does is to extract the 4 digit code in the file. It can be found in front, middle or end of the file name. In the macro file, there's a Directory tab that can check the equivalent name and add the date on Cell A3.
Final renamed version will look like this and save to a different folder.
Singapore_09Sep21.pdf
Spain_09Sep21.xlsx
France_09Sep21.txt
Australia_09Sep21.xls
Any thoughts will be much appreciated.
Thank you!
Hope all is well.
Is it possible to rename a file based on it's equivalent cell value and criteria?
Scenario: I have different multiple files in a folder and in different file format
Sample filenames in a folder
0001 Datasheetxx.pdf
Dataaaaaasheetxx_002T.xlsx
Dataaa_0003_aaasheetxx.txt
0005 Dataaa__aaasheetxx.xls
What the macro does is to extract the 4 digit code in the file. It can be found in front, middle or end of the file name. In the macro file, there's a Directory tab that can check the equivalent name and add the date on Cell A3.
Code | Result | 09Sep21 |
0001 | Singapore | |
002T | Spain | |
0003 | France | |
0005 | Australia |
Final renamed version will look like this and save to a different folder.
Singapore_09Sep21.pdf
Spain_09Sep21.xlsx
France_09Sep21.txt
Australia_09Sep21.xls
Any thoughts will be much appreciated.
Thank you!