VBA loop to open workbooks, copy and paste data

meganduerk

New Member
Joined
Aug 4, 2016
Messages
1
Hi,

I'm hoping I can get some helping with adding VBA code to my workbook that will merge data from multiple "detail" workbooks to one consolidation workbook. I have a list of file paths, names and sheet names in my consolidation workbook. I would like the macro to follow the first "detail" file path & open the first file that I have listed in the consolidation file, go to the specified sheet, find the column which contains x and the row the contains y (x and y are the same in all files) and copy everything to the left and above of x and y, and then paste in the specified sheet in the consolidation file, close the "detail" file and then repeat for the second file in the list and so forth. And then hide each of the consolidated sheet names in the consolidation workbook.

File NameDetail Sheet NameConsolidated Sheet NameFile Path
Department 992016CY Actl99 - General'\\data\corp\actl\[Department 99]2016CY Actl'!
Department 762016 CY Actual76 - Mkt'\\data\corp\actl\Mkt\[Department 76]2016CY Actual'!
etc.

<tbody>
</tbody>



Thank you in advance for your help!

Megan
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,214,965
Messages
6,122,496
Members
449,089
Latest member
Raviguru

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