Extraction files names within folders & sub folders and sum number with text based on modified date

MKLAQ

Active Member
Joined
Jan 30, 2021
Messages
432
Office Version
  1. 2016
Platform
  1. Windows
Hi Experts,
I have names files like this :
INVOICE NO 134,100.00
INVOICE NO 1,000.00
INVOICE NO 115.00
theses files are existed like this
C:\Users\MKK\Desktop\MTK\INVOICE NO 134,100.00.XLSX\
C:\Users\MKK\Desktop\MTK\FILES\INVOICE NO 1,000.00.XLSM\
C:\Users\MKK\Desktop\MTK\FILES\INVOICES\INVOICE NO 115.00.PDF\
so the files extension are xls,pdf
I want macro to extract names to be
column A column B
ITEM FILE NAME(1)
1 INVOICE NO 134,100.00
2 INVOICE NO 1,000.00
3 INVOICE NO 115.00
INVOICES TOTAL 135,215.00
MONTHLY INVOICES TOTAL 135,215.00
I suppose theses files will be JAN-025 for modified date , so will add month number beside file name like this(1) and the first sheet will be its name HOME and when run the macro will add new sheet is YEAR-2025 and will be JAN:DEC for current year 2025. the months will be from column B:M after finish the months for current year will add new sheet calls YEAR-2026 to start new data for new year from B:M as in YEAR-2025.
I would add more example about next month for FEB for 2025 year
C:\Users\MKK\Desktop\MTK\INVOICE NO 134,000.00.PDF\
C:\Users\MKK\Desktop\MTK\FILES\INVOICE NO 15,000.00.PDF\
C:\Users\MKK\Desktop\MTK\FILES\INVOICE NO 11,000.00.XLSM\
C:\Users\MKK\Desktop\MTK\FILES\INVOICE NO 10,000.00.XLS\
so should be
column A column B column C
ITEM FILE NAME(1) FILE NAME(2)
1 INVOICE NO 134,100.00 INVOICE NO 134,000.00
2 INVOICE NO 1,000.00 INVOICE NO 15,000.00
3 INVOICE NO 115.00 INVOICE NO 11,000.00
4 - INVOICE NO 10,000.00
INVOICES TOTAL 135,215.00 170,000.00
MONTHLY INVOICES TOTAL =135,215.00+170,000.00=305,215.00
when some month contains files names more than other months then there is will be empty cells for other month should add zero as hyphen.
as to INVOICES TOTAL should sum each column(MONTH) alone ,MONTHLY INVOICES TOTAL should collect amounts for all of months and put in lastrow for column B.
the column A is ITEM contains 1,2,3......
the column B is FILE NAME(1), column C is FILE NAME(2),,,,,, up to column M

every time run the macro should delete sheets have added before add again to update data
I would make borders and formatting for added sheet
I hope finding assistance.
 
Last edited:

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