excel_newbie86
New Member
- Joined
- Aug 1, 2020
- Messages
- 17
- Office Version
- 2016
- 2007
- Platform
- Windows
Hi all, I'm new in this forum.
I have alot files in Folder, file name the same structure like: aaaaaa-bbbbbbbb-cccccccc-dddddd-ee-f-gg => file name have 39 character with extension (.xlsx, .xls, .prt)
Now I want to have macro VBA to check if file name duplicate 32 character in the left (like: aaaaaa-bbbbbbbb-cccccccc-dddddd-)
If duplicate file found, keep file with the largest number "gg", all files duplicate smaller will be remove to Folder (OLD)
I Attachment 02 picturer with Pictute(1) is the Original file in my Folder and Picturer(2) is file I want to do.
For examble:
Keep file A00014-99207001-01207004-202006-SI-M-09 and remove all file like A00014-99207001-01207004-202006- to Folder (OLD) because 09 is the largest number
Next file
Keep file G00854-99314001-79314013-202006-BI-M-06 and remove all file like G00854-99314001-79314013-202006- to Folder (OLD) because 06 is the largest number
I have alot files in Folder, file name the same structure like: aaaaaa-bbbbbbbb-cccccccc-dddddd-ee-f-gg => file name have 39 character with extension (.xlsx, .xls, .prt)
Now I want to have macro VBA to check if file name duplicate 32 character in the left (like: aaaaaa-bbbbbbbb-cccccccc-dddddd-)
If duplicate file found, keep file with the largest number "gg", all files duplicate smaller will be remove to Folder (OLD)
I Attachment 02 picturer with Pictute(1) is the Original file in my Folder and Picturer(2) is file I want to do.
For examble:
Keep file A00014-99207001-01207004-202006-SI-M-09 and remove all file like A00014-99207001-01207004-202006- to Folder (OLD) because 09 is the largest number
Next file
Keep file G00854-99314001-79314013-202006-BI-M-06 and remove all file like G00854-99314001-79314013-202006- to Folder (OLD) because 06 is the largest number