Choosing sheet before merging data

David Bussell

New Member
Joined
Jun 2, 2009
Messages
22
I have 5 sheets in each of 20 workbooks (the sheets names are common in each workbook). For instance the sheets are called – Tom, Anne, Tim, Paul and **** and rather than merge the data from the sheets named Tom, I would like to merge the data from the sheets name Paul.


I have managed to compose a macro to merge the data from each workbook into a single workbook, with the merged data from each workbook appearing under the last row relating to the previous workbook.


However it only works for the first sheet in each workbook.


What code should I write, before the
'For i = 1 To .FoundFiles.Count'
To be able to choose the sheet. (or am I on the wrong track?)
DB :confused:
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,224,566
Messages
6,179,550
Members
452,927
Latest member
rows and columns

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