VBA help importing survey data into Master file

mfthomps41

New Member
Joined
Jun 22, 2010
Messages
17
Hi. I am wondering if anyone can help me with a macro to import data from multiple (around 500) files that all reside in the same folder, into a single master file.

I would want the following to take place.
1. open first data file (A.xlsx) and copy the survey data (A2:D20).
2. paste the copied data into the Master file (Master.xlsx).
3. close the data file.
4. repeat, opening the remaining files and pasting the corresponding data into the next open rows.

One thing to mention is that each file may have a different number of records, so file A may have 10 lines (A2:D12), and file B may have only 5 (A2:D7).

I am sure this is a pretty simple macro, but I am new to VBA and am lost. Any help is much appreciated. Thanks!
 
Any way to post that so I can copy the whole thing, like the code above. This cuts off and I would have to copy all separate.

I have to leave the office to catch a train. I will check your response when I get home in about an hour.

Thanks so much for all of your help so far!
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,216,558
Messages
6,131,400
Members
449,648
Latest member
kyouryo

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