Skip to main content

How to merge multiple sheets with same headers in Excel?

Author: Sun Last Modified: 2020-05-07

For example, you have some data with the same headers in different sheets as below screenshots shown, and now your job is to merge these sheets into one sheet. Instead of copying and pasting them one by one, this tutorial introduces the better ways for you to handle this job.

doc combine same header 1
doc combine same header 2
doc combine same header 3

Merge sheets with same headers by VBA

Consolidate excel sheets with same headers by Consolidate function

Merge or consolidate excel sheets with same headers by Kutools for Excel good idea3


arrow blue right bubble Merge sheets with same headers by VBA

If you just want to merge the sheets with same headers without any calculations, you can apply the VBA code to solve it.

1. Activate the workbook you want to merge the sheets, press Alt + F11 keys to open Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and then paste below VBA code to the new Module window.

VBA: Merge sheets with same headers

Sub Combine()
'UpdateByKutools20151029
    Dim i As Integer
    Dim xTCount As Variant
    Dim xWs As Worksheet
    On Error Resume Next
LInput:
    xTCount = Application.InputBox("The number of title rows", "", "1")
    If TypeName(xTCount) = "Boolean" Then Exit Sub
    If Not IsNumeric(xTCount) Then
        MsgBox "Only can enter number", , "Kutools for Excel"
        GoTo LInput
    End If
    Set xWs = ActiveWorkbook.Worksheets.Add(Sheets(1))
    xWs.Name = "Combined"
    Worksheets(2).Range("A1").EntireRow.Copy Destination:=xWs.Range("A1")
    For i = 2 To Worksheets.Count
        Worksheets(i).Range("A1").CurrentRegion.Offset(CInt(xTCount), 0).Copy _
               Destination:=xWs.Cells(xWs.UsedRange.Cells(xWs.UsedRange.Count).Row + 1, 1)
    Next
End Sub

3. Press F5 key to run the VBA, and a dialog pops out for you to enter the number of the title rows. See screenshot:

doc combine same header 4

4. Click OK. And all the sheets in the active workbook are merged in a new sheet called “Combined”.

doc combine same header 1
doc plus
doc combine same header 2
doc plus
doc combine same header 3
doc vertical equal
doc combine same header 3

Tip:

(1.) Your data must start from A1, if not, the code will not take effect.

(2.) Your data must have the same structure.

(3.) This code only can combine all worksheets of the active workbook, if you want to merge worksheets from multiple workbooks, this code will not work.


arrow blue right bubble Consolidate excel sheets with same headers by Consolidate function

Supposing you have some data with same column and row headers as below screenshot shown, and you want to merge excel sheets with same headers and then do some calculations, you can apply the Consolidate function in Excel.

doc combine same header 6
doc combine same header 7
doc combine same header 8

1. Open all the workbooks you want to merge sheets from, and place the cursor at a blank cell where you want to locate the merging data, then click Data > Consolidate. See screenshot:

doc combine same header 9

2. Then in the Consolidate window, do as below operation:

1) Select the calculation you want form Function list;

2) Click to select the range you want to merge.

3) Click Add button to add the range into All reference list. To repeat 2) step and 3) steps to add all ranges needed to merged into this list.

4) Check Top row and Left column under Use labels in section.

5) If you want to link the merged data to source data, check Create links to source data.

doc combine same header 10
doc combine same header 11
1) Select the calculation you want form Function list;

2) Click to select the range you want to merge.

3) Click Add button to add the range into All reference list. To repeat 2) step and 3) steps to add all ranges needed to merged into this list.

4) Check Top row and Left column under Use labels in section.

5) If you want to link the merged data to source data, check Create links to source data.

3. Click OK. Now all the data range with same headers are merged into one and sum up by headers.

doc combine same header 6doc combine same header 7doc combine same header 8
doc vertical equal
doc combine same header 12

arrow blue right bubble Merge or consolidate excel sheets with same headers by Kutools for Excel

If in some cases, you want to merge data with same headers only, and in other cases, you want to merge data and consolidate them, are there any tricks can solve both these tasks? Here I introduce Kutools for Excel’s powerful Combine function for you.

Merge excel sheets with same headers

Consolidate multiple sheets with same headers

Kutools for Excel, with more than 300 handy functions, makes your jobs more easier. 

After installing Kutools for Excel, please do as below:(Free Download Kutools for Excel Now!)

Merge excel sheets with same headers

1. Click Kutools Plus > Combine to enable the Combine wizard, and then check Combine multiple worksheets from workbooks into one worksheet. See screenshots:
doc combine same header 14
doc kutools combine 2

2. Click Next> > to go to Combine Worksheets - Step 2 of 3 wizard, and do as below:

doc kutools combine 3
1) Click Add > File/Folder to add the workbooks you may merge sheets from to the Workbook list;
2) Check the workbook name you want to merge the sheets, you can choose multiple workbooks;
3) Check the worksheets you want to combine together;
4) Click doc select to select the range you want to combine, if the ranges are placed in the same location of each sheet, just need to select one range from a sheet then click Same range.

3. Click Next>> to the Combine Worksheet – Step 3 of 3 wizard, and check Combine by row option and type 1 into the textbox of Title row number, if there are no title in your range, type 0 into it.

doc kutools combine 4

4. Click Finish, and a dialog pops out to remind you save this scenario, if you want to save it, click Yes, or No.

doc combine same header 17

Now the sheets are merge with same row headers in a new workbook.

doc combine same header 18

Consolidate multiple sheets with same headers

After installing Kutools for Excel, please do as below:(Free Download Kutools for Excel Now!)

1. Click Enterprise > Combine to display the Combine wizard, and check Consolidate and calculate values across multiple workbooks into one worksheet. See screenshot:
doc kutools combine 5

2. Click Next> > to go to the Combine Worksheets - Step 2 of 3 wizard, and do as below:

doc kutools combine 3
1) Click Add > File/Folder to add the workbooks you may merge sheets from to the Workbook list;
2) Check the workbook name you want to merge the sheets, you can choose multiple workbooks;
3) Check the worksheets you want to combine together;
4) Click doc select to select the range you want to combine, if the ranges are placed in the same location of each sheet, just need to select one range from a sheet then click Same range.

3. Go on clicking Next>>, and select the function you want to apply in the merged range, and check the labels for your merged range. See screenshot:
doc kutools combine 6

4. Click Finish, and a dialog pops out to ask you to save the scenario, click Yes to save, or click No to not save it.

Then the ranges are consolidated in a new workbook.

doc combine same header 12

The advantage of Kutools for Excel’s Combine function is that you can merge multiple sheets across opened workbooks or unopened workbooks into one worksheet or one workbook.

Easily Combine/Consolidate data based on same value in Excel

Supposing you are working with a worksheet which contains multiple duplicate records, and now you need to combine / merge the rows based on the same value and do some calculations, such as sum, average, count of the duplicate rows. With this Advanced Combine Rows of Kutools for Excel, you can quickly combine same values / same data or duplicate rows into appropriate cells.  Click for full-featured free trial in 30 days!
doc advanced combine rows
 
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days.

Relative Articles

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (19)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
When using the VBA code only two of my sheets are combining instead of the three active sheets. The headers are all the same and all start in cell A1. Would you have any idea what the issue is please?
This comment was minimized by the moderator on the site
Bonjour, est-ce possible de Fusionner et LIER Plusieurs Feuilles Avec Les Mêmes En-Têtes Dans Excel afin que les changements qui sont effectués dans les feuilles du classeur soient appliqués dans la nouvelle feuille "combinée"?
This comment was minimized by the moderator on the site
Hello, If you want to combine sheets which with the same sheet names, there is no built-in feature in Excel can help you. You can try Combine feature of Kutools for Excel, it provides an option that combine sheets with same names, for more details, you can visit this tutorial https://www.extendoffice.com/product/kutools-for-excel/excel-combine-sheets-of-same-name-into-one-worksheet.html. And Kutools for Excel supports 30-day free trial, you can download it to have a try. https://www.extendoffice.com/download/kutools-for-excel.html
This comment was minimized by the moderator on the site
Very helpful the code for combining multiple worksheets, it worked fine! Thank you!
This comment was minimized by the moderator on the site
what will be vba code for combining multiple sheets in workbook into one worksheet if row headers are the same ( not column headers)
This comment was minimized by the moderator on the site
I used VBA to copy all sheets to one, but how can I copy only select sheets instead of all of them?
There are no comments posted here yet
Load More
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations