Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to merge multiple sheets with same headers in Excel?

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

Easily Combine multiple sheets/Workbook into one Single sheet or Workbook

To combinne multiples sheets or workbooks into one sheet or workbook may be edious in Excel, but with the Combine function in Kutools for Excel, you can combine merge dozens of sheets/workbooks into one sheet or workbook, also, you can consolidate the sheets into one by several clicks only.  strong>Click for full-featured 30 days free trial!
combine sheets
 
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days.

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

Tabbed browsing & editing multiple Excel workbooks/Word documents as Firefox, Chrome, Internet Explore 10!

You may be familiar to view multiple webpages in Firefox/Chrome/IE, and switch between them by clicking corresponding tabs easily. Here, Office Tab supports similar processing, which allow you to browse multiple Excel workbooks or Word documents in one Excel window or Word window, and easily switch between them by clicking their tabs. Click for free 30-day trial of Office Tab!

ot excel

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 Enterprise > Combine to enable the Combine wizard, and then check Combine multiple worksheets from workbooks into one worksheet. See screenshots:

doc combine same header 13
doc combine same header 14

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

doc combine same header 15
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 type 1 into the textbox of Title row number, if there are no title in your range, type 0 into it.

doc combine same header 16

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 combine same header 19

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

doc combine same header 20
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 combine same header 21

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


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

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!
officetab bottom
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    daniel · 5 months ago
    Esta excelente la primera macro, pero no sabrias decirme por que solamente me combina 4 columnas?. Si mis hojas tienen un aproximado de 30 columnas.
  • To post as a guest, your comment is unpublished.
    Ezequiel Zavaleta · 7 months ago
    Hello
    I bought Kutools for Excel 19.00, by interest in the merge function, but doesn't work with my files and sheets, all have the same name (Workbook an sheets) but in the combination of : "Combine all same name worksheets into one worksheet" dosn't work (does nothing), inclusive don't saves the new workbook in the place that I select prior to execute de Finish button.
    I followed the instructions one and another time, but the result is the same.
    Some help?
    • To post as a guest, your comment is unpublished.
      Sunny · 5 months ago
      Hi, Ezequiel Zavaleta, I am sorry for hear that. You can contact our Customer Service Manager through this: support@extendoffice.com our team will solve your problems as soon as possible.
  • To post as a guest, your comment is unpublished.
    wayne · 11 months ago
    perfect, thank you
  • To post as a guest, your comment is unpublished.
    Gio · 1 years ago
    How can I combine only sheets with same header ignoring other sheets?
  • To post as a guest, your comment is unpublished.
    Charles · 1 years ago
    How do I merge only select worksheets in that workbook?
    How can I run the Macro to refresh the data on a weekly basis without having to delete the "Combined" tab?
  • To post as a guest, your comment is unpublished.
    Sarang · 1 years ago
    I want to combine sheets... but I also want to add a column ("A") in new sheet (combined) where the name of the sheet "Sheet1", "Sheet2" will be placed on all rows copied from respected sheets.. so i will know which data has come from which sheet.
    • To post as a guest, your comment is unpublished.
      Sunny · 1 years ago
      You can try Kutools' Combine function, it can insert the data information of each sheet in the front of data in combined sheet.
  • To post as a guest, your comment is unpublished.
    Steven · 1 years ago
    I have the same problem as Saurabh. It merges the worksheets and has a blank row after each data from the worksheet is copied. However, the header is not copied to the new "Combined" worksheet either. I'm using Excel 2016. Thank you for the code, it does help minimize the time I spend. I don't think I'll be able to figure out the issue with the code and hope that you can look into it. Thanks again.
  • To post as a guest, your comment is unpublished.
    vinay naik · 1 years ago
    Hello,


    I have checked your VB formula for VBA: Merge sheets with same headers its absolutely helpful to me, but i need little support I want to create macro for this file. Like I have to to download file every time save with some unique name & run macro to combine sheet.

    Please confirm.
  • To post as a guest, your comment is unpublished.
    Saurabh · 2 years ago
    I used 'VBA: Merge sheets with same headers' but it leaves a row empty after each sheet data how do I correct this. It is possible to modify the code?
    • To post as a guest, your comment is unpublished.
      Sunny · 2 years ago
      I do not know why a empty row leave while you merging the data by using the VBA, that do not happen to me. If there are some blank rows needed to be remove, you can press F5 to open Go To dialog, and click Special > Blanks to select all blank cells, the right click to remove the blank rows.

      But with the Go To Special function, it will select blank cells not the blank rows which not work well while a row has data missing. In this case, you can apply Kutools for Excel's Delete Blank Rows, which can remove empty rows in selection, active worksheet, selected sheets or whole workbook.