You are currently viewing How to merge Excel files into one

How to merge Excel files into one

You have several Excel files that make it harder for you to access data. You keep switching between different opened files, and this process takes a lot of your time. You are well aware that it is a lot easier to process data in a single file instead of switching between numerous sources. Then comes the question, how can I merge all these files into one comprehensive file? It is a troublesome and long process trying to combine different Excel files into one file when you factor in the number of worksheets found in one workbook. There are various ways of merging Excel files.

In this article, we discuss how to merge multiple Excel files into one file. Let's get started.


Method 1: Combine multiple workbooks into one workbook with the Move or Copy function

1. If you want to merge all the existing files into a new Excel workbook, create the new Excel workbook and open it. But if you're going to combine all of them into a current workbook, open that workbook.

2. Open all the Excel files you want to merge. You need to open all files to be able to combine them into one. Instead of doing it manually, select all the files and press the enter key on your keyboard. To select multiple files that are non-adjacent, hold the Ctrl key and clicks the files one by one. For adjacent files, hold the Shift key and click on the last file to select them all.

3. Maximize the first file you want to merge.

4. Right-click the worksheet you want to merge, then select Move or Copy.

5. On the pop-up window, click 'Pick from Drop-down List.' All the Excel files opened on your computer will be displayed here

6. Select the excel file you want to merge other files into in the 'To book' drop-down arrow.

7. To merge excel files, check the Create a copy checkbox.

8. In the Before Sheet section, select 'move to end and click OK. It will create a copy of the worksheet in the destination file.

9. Repeat all the above steps for all the remaining files and save your file.


Method 2: Combine multiple workbooks to one with VBA

1. Open a new workbook that will act as a master workbook.

2. Press Alt + F11 to the VBA page

3. Click on the Insert tab. Next, select the Module tab.

4. Copy and paste the macro code below.

Sub GetSheets()
'Updated by Extendoffice 2019/2/20
Path = "C:\Users\dt\Desktop\dt kte\"
Filename = Dir(Path & "*.xlsx")
  Do While Filename <> ""
  Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
     For Each Sheet In ActiveWorkbook.Sheets
     Sheet.Copy After:=ThisWorkbook.Sheets(1)
  Next Sheet
     Filename = Dir()
End Sub


more code:

5. After this, it is time to initiate the command by pressing F5 to run the excel macro code. Doing this will open a file and then copy the data. It will paste the same in your new workbook. Close the workbook.


Method 3: Merging Microsoft Excel files as CSV files.

1. Open the excel files.

2. Go to the Menu bar. Click File. Then Save As.

4. In the Save as type, there is a drop-down list. Select CSV from the list.

5. Do this for all the files you want to merge, and then place all the CSV files into one folder.

6. Type the following command to merge all CSV files in the folder into a new CSV file. Copy *.csv new file. CSV

7. After creating the new file, open the new CSV file in Microsoft Excel.

8. save it as an Excel file.



The above tips help you to be organized and save time. Whether you decide to merge data in excel into a single file, or if you prefer to spread your work across multiple files, either of the methods above will help you. Excel offers immense features such as an in-built tracking feature that keeps track of any changes made in your files. So, losing your original data should not be a cause of the dilemma.