copy data from multiple files in a folder with their respective filenames into 1 actively open sheet

Kvt

New Member
Joined
Jul 29, 2021
Messages
1
Office Version
  1. 2013
Platform
  1. Windows
Hi Champs

Fairly new to VBA coding and need help please.

I need to copy data from multiple files in a folder with their respective filenames into 1 actively open sheet.

Example
A File from Adam (adam.xls) has data
ColumnA ColumnB columnC
Cookie sugar flour
Pizza sauce cheese

Another File from Alex (alex.xls) has data
ColumnA ColumnB columnC
Cake Chocolate raisins
Bread flour water

I want a code that will combine the above 2 file data kept in a folder with their file names.

Expected output
ColumnA ColumnB columnC columnd
Cookie sugar flour Adam.xls
Pizza sauce cheese Adam.xls
Cake Chocolate raisins Alex.xls
Bread flour water alex.xls

This way I would know who sent what data.

Possible? Please advise.

Thanks heaps
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi Kvt,

Are the files you are looking to aggregate in the same layout (column headers match, data is stored in the same manner)

If so, you may want to consider using Power Query. Here's a great video on how to go about setting one up.

 
Upvote 0

Forum statistics

Threads
1,215,903
Messages
6,127,652
Members
449,395
Latest member
Perdi

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