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.
You must have Microsoft Excel installed into your computer to start learning how to merge sheets in Microsoft Excel.
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.
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.
Step 4: Finally, you can paste the cells into other sheets.
-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.
-Press Alt + F8, the dialog macro will open.
-Under the Macro name, select Example_Merge_ExcelSheet.
-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.
-After you have done choosing the multiple sheets, finally, it successfully merges it into one workbook.
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.