Merge Multiple Excel Files Into One Excel File

Import » Merge and/or import multiple files. This utility will merge multiple files from a folder together into one new file. You can also use it to import multiple files at once into your workbook. Excel has no built-in method for merging files. It can therefore be time consuming and frustrating if you for example need to import or merge. Combine all of the data from the files into one big table – once we connect to this data source, we need to be able to combine/consolidate/append all of the data from each of those excel files into one big table.

How to COMBINE Multiple Excel WORKBOOKS into One Workbook

Combine multiple excel workbooks into one workbook

We might need to combine multiple excel workbooks into one workbook in order to analyse or present the information better. Though this can be done manually, by moving or copying all the worksheets from different workbooks into one workbook, but it would be time consuming and prone to errors. Moreover if there are a large number of workbooks/worksheets, then the problem is even bigger.

However, we have a solution to this and it would not take more than a few seconds to get all workbooks merged into one. Here is the VBA code that can help us achieve this. Even those who are not well versed with VBA can easily get this done by simply following the steps on how to use this code:

VBA Code for XLS Files

VBA Code for XLSX Files

How to Use this Code?

Below are the steps to use this code and there’s also a video at the end:

  • (1) All the Excel workbooks that you want to combine should be placed in a folder – For the purpose of this tutorial, we have created a folder named 'Excel Workbooks' and have three files in it.
  • (2) Open a new Excel workbook.
  • (3) Press ALT + F11 (or go to Developer –> Visual Basic). This will open the Visual Basic Editor.
  • (4) In the VB Editor menu go to Insert –> Module. This will insert a module for the workbook with a blank code window.
  • (5) Copy and paste the above code into the code window.
  • (6) In the code, you need to change the following line of code:
  • (7) In this line, insert the location of the folder in which you have placed the files that you want to combine, between quotes. In the code used above, the folder is in 'Documents'. Get the path by visiting the folder and clicking on the address bar dropdown. We insert C:UsersNiteshDocumentsExcel Workbooks between the quotes. (Note that a back slash has been added at the end of the folder path)
  • (8) Place the cursor anywhere in the code and click on the green play button in the Toolbar options (or press the F5 key).
  • (9) This will activate the code and all worksheets from all the Excel workbooks in the folder would get consolidated into a single workbook.
  • (10) Save the Master Workbook, and you're done.

How does this Code Work?

The code uses the DIR function to get the file names from the specified folder.

The following line assigns the first excel file name to the variable 'Filename'.

Filename = Dir(Path & '*.xls*')

Then the Do While loop is used to check whether all the files have been covered.

Within the Do While loop, For Each loop is used to copy all the worksheets to the workbook in which we are running the code.

At the end of the Do Loop, following line of code is used: Filename = Dir(). It assigns the next Excel file name to the Filename variable and the loop starts again.

When all the files are covered, DIR function returns an empty string, which is when the loop ends.

Here is an explanation of the DIR function in the MSDN library:

Dir returns the first file name that matches pathname. To get any additional file names that match pathname, call Dir again with no arguments. When no more file names match, Dir returns a zero-length string (').

We hope you found this interesting. Your comments/feedback would be appreciated.


Last updated on August 8th, 2020 at 08:09 pm

Reading Time: 7minutes

Excel Merger is a free tool for combining multiple Microsoft Excel (XLS/XLSX) files into one file. You can also use it to merge multiple Excel Spreadsheets and Workbooks into a single file or Workbook.

Merge multiple excel files into one excel file online

As if that’s not enough already, this tool merges columns and rows in an Excel worksheet. And just as important, it also supports the merging of ODS/CSV/XML files.

The software’s claim to fame is its ability to consolidate data in a single file or Workbook in a few sort clicks. As a result, Excel Merger allows you to quickly summarize and analyze data in a single sheet/workbook.

Benefits of Merging Excel Files into One

Regardless of your field, there are many reasons why you would want to merge multiple excel files into one sheet. For example, if you’re an analyst or manager, you would need to combine budgets and estimates from various departments. A student may need to combine assignments, analyses, research data, etc.

In addition to making the information more presentable, excel merging helps you to create one single reference file. You won’t have to move back and forth between multiple documents just to find all the information you need. Instead, you consolidate all the useful data from more than one source and summarize it in one place.

Besides, the best merge Excel files tools allow you to use source data from different worksheets that are not Excel files. For instance, Excel Merger can import data from ODS/CSV/XML and consolidate it in one Excel file. That’s very important because, more often than not, it’s easier to manipulate data in Excel than in other formats.

Excel Merge: The Best Free Tool for Merging Excel Files

There are so many excel combine tools, but Excel Merger packs just enough features to edge them all. Below are all the good things that it brings to the table:

  • Free: Excel Merger is completely free to download and use. It’s a PC-based software that works on all versions of Windows from XP all through Windows 10. With a size of 3.3 MB, the file is small and lightweight enough for new and older computers.
  • Effective Excel combines tool: the software allows you to merge multiple Excel files into a single file in just 3 steps. Please read the step-by-step guide below to find out how you can do that.
  • Create one spreadsheet: in addition to creating one Excel file, this program can pick multiple spreadsheets from multiple Excel files and merge them into one spreadsheet in a single Excel file.
  • Merge workbooks and worksheets: if you have multiple workbooks in a file, you can use Excel Merge to combine them all in a single worksheet for easy analysis. Similarly, the software can merge workbooks from different files into one workbook in one file.
  • Sheet range: this function allows you to select a few worksheets from an Excel file and merge only them instead of merging the entire document. This is a handy feature for when you only need data from a select number of worksheets rather than the entire document. You can specify the range of worksheets yourself.
  • Merge rows and columns: you can pick particular rows and columns from many different files or spreadsheets and merge them in one spreadsheet. For example, you can pick row 2 from one document, row 14 from another document and row 27 from the final document and then combine them into a single row in one spreadsheet. In essence, Excel Merger consolidates data from any number of rows or columns into one row/column for easy analysis.
  • Import data from other file formats: Excel Merger is the best Excel editor because it can import data from ODS (Open Document Sheets) CSV (Comma-Separated Values) and XML (Extensible Markup Language) files.
  • Ultra-fast: merge files, spreadsheets and worksheets in just 3 steps. Excel Merger processes the data lightning-quickly to get the job done.
  • Doesn’t require Microsoft Excel or Microsoft Office: you don’t need to install Office or Excel to use Excel Merger.
  • Multi-lingual: supports English, Chinese, Dutch, French, German, Greek, Italian, Japanese, Korean, Polish, Portuguese, Russian, Spanish, and Swedish

How to Merge Excel Files, Spreadsheets and Workbooks with Excel Merger: A Step by Step Guide

First, download Excel Merger for Windows here.

Once installed you can perform any of the following Excel merging functions:

1. Merge Multiple Excel Files into One Excel File

How do I consolidate multiple Excel files? Below is a complete guide. Note that Excel Merger supports both XLS and XLSX type of files.

Step 1: Add files to Excel Merger

There are two ways of doing that. First you can drag and drop your files to the program’s interface. Secondly, you can use the “Add” button.

Click on it and then browse your PC to where the files are located. Select all the ones that you want to merger and click “Open” to add them.

Step 2: Set options

Since you are merging files, select “Files” in the Merge dropdown menu.

Head over to the “Output” dropdown menu and choose your preferred output format. It’s XLSX by default but your options are XLS, XLSX, CSV, XML & ODS. Finally, set your output path under the “Save to” option.

Step 3: Merge

Click on “Start Merging Now” to consolidate your Excel files into one.

Excel Merger will automatically open the output folder once the merger is complete.

2. Merge Excel Spreadsheets and workbooks into one

How do you merge two excel spreadsheets together? And how do you merge two Excel workbooks together? Excel Merger can help. Better yet, it can merge more than two spreadsheets or workbooks. Here’s how:

Step 1: Add files to Excel Merger

You can either drag and drop Excel files or use the “Add” button.

Step 2: set options

Since you are merging sheets, select “Sheets” in the Merge dropdown menu.

Go to the “Output” dropdown menu and choose your preferred output format between XLS, XLSX, CSV, XML & ODS. Specify the worksheet range if you only want to merge a few worksheets instead of the entire file. Finally, set your output path under the “Save to” option.

Step 3: Merge

Click on “Start Merging Now”.

Excel Merger will combine all the workbooks in all the files that you added and produce one consolidated worksheet.

3. Merge Multiple Excel Files into One Excel Workbook

How do I consolidate multiple Excel files into one workbook? Below is a step-by-step guide. It will help you merge several Excel files into a single Excel workbook in one Excel file.

Step 1: Add files to Excel Merger

Drag and drop Excel files onto Excel Merger or use the “Add” button.

Step 2: set options

In the Merge dropdown menu, select “Files & Sheets”.

In the “Output” dropdown menu, choose your preferred output format. It could be XLS, XLSX, CSV, XML or ODS. Now, set your output path under the “Save to” option.

Step 3: Merge

Click on “Start Merging Now” to combine all the selected Excel files and workbooks into one one file

4. Merge Excel Rows and Columns in a Worksheet

How do I combine columns in Excel? And how can I merge rows in a spreadsheet?

Step 1: Add files to Excel Merger

Drag and drop Excel files to the Excel Merger interface or use the “Add” button.

Merge Multiple Excel Files Into One Excel File Online

Step 2: set options

Click on the “Merge” dropdown menu and choose either “Rows” or “Columns”.

Needless to say, choose the latter if you’re merging multiple columns and the former if you’re merging multiple rows.

In the “Output” dropdown menu, select your preferred output format (XLS, XLSX, CSV, XML or ODS). Finally, set your output path under the “Save to” option.

Step 3: specify range

Head to the boxes labelled “Start” and “End” and then type in the first row/column and the last row/column (respectively) that you want to merge.

Remember to specify the delimiter. This is basically a separator for rows/columns. It’s blank by default but you can choose a sign/symbol of your liking.

Step 4: choose what to do with empty rows/columns

By default, Excel Merger will merge rows/columns in the first row/column of the new worksheet and leave the original rows/columns empty. But you can tell it what to do with those empty rows/columns.

Check the “Keep Empty Rows/Columns” option if you want to retain them or uncheck it if you want to remove them.

Step 5: Merge

Click on “Start Merging Now” to merge your rows/columns.

Merging Other Workbook File Formats

Merge Multiple Worksheets Into One Excel File

You can use the same procedures to merge files that are saved in other workbook formats besides Excel (XLS and XLSX). Specifically, Excel Merger allows you to merge CSV, XML and ODS files.

Merge Multiple Excel Files Into One File C#

In the first step – when adding files – simply choose all the files that you want to merge, whether they are XLS, XLSX, CSV, XML or ODS files. Then follow the above procedures for merging files, worksheets, workbooks, rows and columns.