How to Merge Excel Sheets

Introduction

Merging is an essential tool for Excel. It's a perfect tool to save time on your task. Excel is so powerful, It is often difficult to navigate if you're not trained on using it. I'll teach you some strategies in this article, different ways to merge Excel sheets.

Prerequisites

You must have Microsoft Excel installed into your computer to start learning how to merge sheets in Microsoft Excel.

Merge excel sheets

Merging cell is a function in database programming that helps combine multiple neighboring cells into one. It is achieved by choosing almost all of the linking cells and use the "Merge Cells" function.

Method 1: Merge excel sheets into one workbook

The simplest way to combine excel sheets is to choose the various sheets and insert them from one worksheet only.

Follow the step below:

Step 1: Launch Microsoft Excel. Then choose a sheet that you wanted to be inserted into the other sheet.
Step 2: Hold the Ctrl key on your keyboard and left-click your mouse, then select the cells you want to merge into another sheet or just hold the Ctrl+ A key.
Step 3: After you select the cells, right-click in your mouse and choose Copy from the menu.

Screenshot of Cell You Want to Merger
Step 4: Finally, you can paste the cells into other sheets.

Method 2: Merge Excel Sheet using VBA

Step 1: Add Macro to your workbook

-Press Alt + F11, the visual Basic Editor will open.
-Select “insert” then “Module” from the context menu
-In the windows that appear, paste this code:

Sub  Example_Merge_ExcelSheet()
Dim  fnameList, fnameCurFile As  Variant
Dim  countFiles, countSheets As  Integer
Dim  wksCurSheet As  Worksheet
Dim  wbkCurBook, wbkSrcBook As  Workbook
fnameList = Application.GetOpenFilename(FileFilter:="Microsoft Excel Workbooks (*.xls;*.xlsx;*.xlsm),*.xls;*.xlsx;*.xlsm", Title:="Choose Excel files to merge", MultiSelect:=True)
If  (vbBoolean <> VarType(fnameList)) Then
If  (UBound(fnameList) > 0) Then
countFiles = 0
countSheets = 0
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Set  wbkCurBook = ActiveWorkbook
For  Each  fnameCurFile In  fnameList
countFiles = countFiles + 1
Set  wbkSrcBook = Workbooks.Open(Filename:=fnameCurFile)
For  Each  wksCurSheet In  wbkSrcBook.Sheets
countSheets = countSheets + 1
wksCurSheet.Copy after:=wbkCurBook.Sheets(wbkCurBook.Sheets.Count)
Next
wbkSrcBook.Close SaveChanges:=False
Next
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
MsgBox "Processed "  & countFiles & " files"  & vbCrLf & "Merged "  & countSheets & " worksheets", Title:="Merge Excel files"
End  If
Else
MsgBox "No files selected", Title:="Merge Excel files"
End  If
End  Sub

-Then press ctrl + s key to save this on your computer.

Step 2: Use the VBA code

-Press Alt + F8, the dialog macro will open.
-Under the Macro name, select Example_Merge_ExcelSheet.

Screenshot of Macro Name

-Then click the run button.

-After you run the macro, the standard window will open, then you can choose multiple sheets that you want to merge into one workbook.

Screenshot of Merged Sheets

-After you have done choosing the multiple sheets, finally, it successfully merges it into one workbook.

CONCLUSION

In this tutorial, we learn how to merge multiple excel files into one, and using one of these methods is really a great time saver. This is a great practice for excel beginners or intermediate level regardless of what field your job is on.

Published: 
July 7, 2020
Author:
500 Rockets
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram