Restrict move files from folders and subfolders to new folders based on files names

Abdo

Board Regular
Joined
May 16, 2022
Messages
228
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Hi,
I have PDF files in this directory "C:\Users\AAB\Desktop\INN\"
the directory contains many folders and subfolders like this
"C:\Users\AAB\Desktop\INN\REPORTS\NO PP1000.PDF"
"C:\Users\AAB\Desktop\INN\MAIN\NO SS122222.PDF"
"C:\Users\AAB\Desktop\INN\REPORTS\OPERATION\LAST\FINAL\NO PP7000.PDF"
"C:\Users\AAB\Desktop\INN\MAIN\FIRST\NO SS444444.PDF"
what I want first orginizate the files by add new folders and move files to new folders based on last modified date for each new folder .
Example for last modified date will be 7(JULY):
"C:\Users\AAB\Desktop\INN\REPORTS\NO PP1000.PDF"
"C:\Users\AAB\Desktop\INN\REPORTS\OPERATION\LAST\FINAL\NO PP7000.PDF"
should add folders names based on after NO item for PDF files and month numer based last modified date . like this
from
"C:\Users\AAB\Desktop\INN\REPORTS\NO PP1000.PDF"
to
"C:\Users\AAB\Desktop\INN\REPORTS\PP7\NO PP1000.PDF"
anothr example
"C:\Users\AAB\Desktop\INN\REPORTS\OPERATION\LAST\FINAL\NO PP7000.PDF"
to
"C:\Users\AAB\Desktop\INN\REPORTS\PP7\NO PP7000.PDF"
and should delete old folders from original directory (OPERATION\LAST\FINAL as example )


any PDF files contains the same letter regardless different numbers what contains in files names , should move to the same folder matches for letters are after NO item for PDF files based last modified date. last modified date will be from 1 to 12 months.
thanks
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,224,812
Messages
6,181,094
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top