Merge multiple excel files in one, keeping multiple sheets in VBA

Lugesz

New Member
Joined
Jul 10, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Dears,

I have a dataset coming in different files, and these files have different sheets. Structure of Sheet1 e.g. in all files are the same. I would like to merge these files to one master file, by merging the different sheets into the masterfile.

Like this:

1688987955143.png


Can you please help?

Thanks!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Please describe the merge in more detail. Will the two source sheets merge then go away or does the merge happen more than once? Does the merge require that the entire sheet from the two source workbooks get transferred as-is?
 
Upvote 0
My understanding is: merge all Sheet1's from the source workbooks to Sheet1 in the Master workbook, one below each other; merge all Sheet2's from the source workbooks to Sheet2 in the Master workbook, one below each other; and so on.

This is fairly easy to do in a VBA macro, but I'd like to see it done with Power Query. I found several PQ examples showing how to merge multiple sheets from multiple source workbooks to a single sheet in a Master workbook, but none showing how to merge them to multiple sheets, with respect to the source sheet names.
 
Upvote 0
Please describe the merge in more detail. Will the two source sheets merge then go away or does the merge happen more than once? Does the merge require that the entire sheet from the two source workbooks get transferred as-is?
The two source sheets go away. I receive source sheets e.g. every month, so it happens more than once, but I can manage if it is just a one time routine, I manage source files in the back.

It is required that entire sheet should be merged. They have the same structure and dataset.

Thanks.
 
Upvote 0
My understanding is: merge all Sheet1's from the source workbooks to Sheet1 in the Master workbook, one below each other; merge all Sheet2's from the source workbooks to Sheet2 in the Master workbook, one below each other; and so on.

This is fairly easy to do in a VBA macro, but I'd like to see it done with Power Query. I found several PQ examples showing how to merge multiple sheets from multiple source workbooks to a single sheet in a Master workbook, but none showing how to merge them to multiple sheets, with respect to the source sheet names.
That is the way how I understood. I am happy if it is easy, :) I could not find, only macros where you merge several workbooks into one workbook. But not found any which would keep sheets as they are.
 
Upvote 0

Forum statistics

Threads
1,215,201
Messages
6,123,621
Members
449,109
Latest member
Sebas8956

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