How sort files contains specific word based on modified dates

abdelfattah

Well-known Member
Joined
May 3, 2019
Messages
1,489
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Hello ,
I have files PDF or xlsm, xls, xlsx,csv in this directory C:\Users\ASIF\Desktop\TM\ and every file contains word INVOICE NO & #,##0.00
I want sort files character word INVOICE NO & #,##0.00 and ignore others files .
example FILE NAME: INVOICE NO 12,000.00
MODIFIED DATE : 22/09/2024 AM 02:45
example FILE NAME: INVOICE NO 13,000.00
MODIFIED DATE : 23/09/2024 AM 04:45
example FILE NAME: INVOICE NO 14,000.00
MODIFIED DATE : 23/10/2024 AM 01:45
example FILE NAME: INVOICE NO 16,000.00
MODIFIED DATE : 23/10/2024 AM 04:45


so should create folder like this INVOICES_2024 based on current year
then will create folder based on modified date for the SEP month within INVOICES_2024 folder
the folder will be Sep and move files to SEP folder and will be sort for the last modified date
result for dates in September like this will show first INVOICE NO 13,000.00
second will show INVOICE NO 12,000.00

as to OCT folder will create folder based on modified date for the OCT month within INVOICES_2024 folder
the folder will be OCT and move files to OCT folder and will be sort for the last modified date
result for dates in September like this will show first INVOICE NO 16,000.00
second will show INVOICE NO 14,000.00
last thing should be sort EXCELS files before PDF files
always should sort files from the last date to first date
thanks
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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