Tips for merging multiple sheets into one sheet in Excel
Tips for merging multiple sheets into one sheet in Excel: Do you need to merge data from multiple sheets into one sheet? Are you concerned that copying and pasting each sheet will take a lot of time and may lead to errors in the consolidated file? Follow the steps below to learn how to quickly and easily merge multiple sheets into one sheet in Excel.
For example, let’s say you want to merge 3 sheets A, B, C into one sheet as shown below.
The fastest way to merge sheets is to use VBA code. VBA code can help you combine the data from all sheets in the current Excel file into a new sheet. The prerequisite is that all worksheets must have the same structure, column headers, and column order. Follow the steps below:
Step 1
First, press the Alt + F11 shortcut key to open the VBA window.
Step 2
Next, select the Insert tab. The scroll bar appears and you select the Module option.
Step 3
The Module window appears, copy the code below and paste it into the window.
Sub Combine()
Dim J As Integer
On Error Resume Next
Sheets(1).Select
Worksheets.Add
Sheets(1).Name = “Combined”
Sheets(2).Activate
Range(“A1”).EntireRow.Select
Selection.Copy Destination:=Sheets(1).Range(“A1”)
For J = 2 To Sheets.Count
Sheets(J).Activate
Range(“A1”).Select
Selection.CurrentRegion.Select
Selection.Offset(1, 0).Resize(Selection.Rows.Count – 1).Select
Selection.Copy Destination:=Sheets(1).Range(“A65536”).End(xlUp)(2)
Next
End Sub
Step 4
Then press F5 to run the code.
That’s it, the data from all sheets in the Excel file has been merged into a sheet named Combined, which is placed before the other sheets.
Thus, the article above has instructed you on how to merge multiple sheets into one sheet in Excel. We hope this article will be useful to you in your work. Wish you success!