Using VBA to copy/past from multiple workbooks

joek128

New Member
Joined
Jul 22, 2016
Messages
23
Hey guys.

I made a post here yesterday and I think my question turned out to be more confusing than it needed to be. So here goes another shot...

I'm looking to pull data from multiple workbooks into a master file with the following layout:

Name2010 Salary2010 Bonus2011 Salary....
Joe
John
Emily
....

<tbody>
</tbody>

The Number of employee names and column headers can increase/decrease depending on the data needed.

Each employee has a file on the C drive under "C:\[Employee Name]\Information\[Employee Name].xl"
The tab [Summary] contains data in the following format (the same format for each file, however some employees only have 1,2,3 etc years of past data)

200920102011
Salary$20000$20000$25000
Bonus$5000$5000

<tbody>
</tbody>

I've been trying to figre out the best way to create a VBA loop that will open the file based on the individuals listed in column A and paste data based on the headers in row 1. I've been trying to do this using an Index/Match function but would like to see if this is possible with VBA as it has become increasingly difficult to do it using normal function on Excel.

Hopefully this is more clear than my question asked last night.

Thanks in advance for the help.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I used a nested loop. First loop opened each file based on the next name in the list (offset loop). Second loop functioned as an index/match on the active workbook. I simply used an index match to locate the value I needed, defined it as a new variable, and even entered the variable to the correct column on the master workbook using another offset function.

It's at the office so I'll have to wait till tomorrow to copy the syntax, but I'm happy to share what I wrote.
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,425
Members
448,961
Latest member
nzskater

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