Copy and paste to another master folder

Excelexcel86

Board Regular
Joined
Feb 28, 2023
Messages
99
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Hi guys I’m looking for a macro to do the following. I have about 16 folders in total with different amount of data in all what I’m hoping to do is for every folder copy the most recent file they are csvs and put into master workbook but then when the original folders have new data put into them I want to copy the new file but then replace the file that was in the master from that folder .so basically it ends up with 16 files in master folder where each file is always the newest .
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Is each latest csv in a separate sheet in the master workbook?
Then it is quite easy:
  1. Loop thru each of the folders
    1. Get the youngest file
    2. Remove the worksheet for that folder
    3. Replace it with the found file
  2. Save the master
there are plenty posts on how to loop through folder
there are plenty posts on how to import a csv

On how to find the latest csv, here is an example: Open most recent .csv file in a folder

If you need help pasting this all together, let me know
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,264
Members
449,075
Latest member
staticfluids

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