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

Abdo

Board Regular
Joined
May 16, 2022
Messages
191
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

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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