How to merge excel files into one sheet
Tutor 5 (82 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
Merging Excel files into one sheet means combining data from multiple workbooks or worksheets into a single, unified worksheet. This process creates a consolidated view that supports analysis, reporting, and automation. To merge Excel files into one sheet, follow a structured process that imports each dataset and places it into a target worksheet. The steps below describe methods that work on Windows and macOS, with platform differences stated clearly.
Method 1: Merge Files Using Power Query (Most Efficient Method)
Power Query imports, transforms, and consolidates datasets from multiple files with automation capability.
Windows Steps
-
Place all Excel files in a single folder.
-
Open a new workbook.
-
Select Data > Get Data > From File > From Folder.
-
Choose the folder that contains the files.
-
Click Combine > Combine & Load.
-
Select the worksheet or table to extract from each file.
-
Load the merged data into a single sheet.
Mac Steps
-
Place all Excel files in a single folder.
-
Open a new workbook.
-
Select Data > Get Data.
-
Choose From Folder.
-
Navigate to the folder and select it.
-
Click Combine.
-
Choose the worksheet or table to extract.
-
Load the merged data into the sheet.
Advantages
-
Power Query refreshes data with one click.
-
Power Query supports dozens of files.
-
Power Query cleans and reshapes data during import.
How to Merge Excel Files Into One Sheet Using Copy and Paste
To merge files manually, data must be copied from each file and pasted into a destination sheet.
Steps
-
Open the destination workbook.
-
Open the first source workbook.
-
Select the dataset using Ctrl + A (Windows) or Command + A (Mac).
-
Copy the data using Ctrl + C (Windows) or Command + C (Mac).
-
Paste the data into the destination sheet using Ctrl + V (Windows) or Command + V (Mac).
-
Leave a blank row or use a continuous paste region based on the structure.
-
Repeat the steps for every file.
Limitations
-
Manual merging increases error rates.
-
Manual merging requires time for large batches.
-
Manual merging does not support refresh automation.
How to Merge Excel Files Into One Sheet Using VBA
This method is helpful when merging dozens or hundreds of files repeatedly.
Steps
-
Place all Excel files in one folder.
-
Press Alt + F11 to open the Visual Basic Editor.
-
Select Insert > Module.
-
Paste the VBA script:
Sub MergeFilesIntoSheet()
Dim wb As Workbook
Dim ws As Worksheet
Dim folderPath As String
Dim file As String
Dim targetSheet As Worksheet
Dim lastRow As Long
folderPath = "C:\YourFolderPath\" 'Change folder path
Set targetSheet = ThisWorkbook.Sheets("Sheet1")
file = Dir(folderPath & "*.xlsx")
Do While file <> ""
Set wb = Workbooks.Open(folderPath & file)
Set ws = wb.Sheets(1)
lastRow = targetSheet.Cells(targetSheet.Rows.Count, 1).End(xlUp).Row + 1
ws.UsedRange.Copy targetSheet.Cells(lastRow, 1)
wb.Close False
file = Dir
Loop
End Sub
-
Change
folderPathto your folder location. -
Run the script using F5.
Advantages
-
VBA automates merging fully.
-
VBA handles large batches without interaction.
How to Prepare Data Before Merging
Data consistency increases merge accuracy. Use identical column headers, matching formats, and consistent row structures.
Steps
-
Standardize column headers across all files.
-
Clean unwanted spaces, symbols, and merged cells.
-
Convert each dataset into a table using Ctrl + T (Windows) or Command + T (Mac).
-
Confirm that each table has matching field names.
When Should You Use Each Method?
-
Power Query: Large datasets, frequent refreshes, automation needs.
-
Copy/Paste: Small datasets, one-time merging.
-
VBA: Repetitive merging, high-volume file batches.
Common Issues and Solutions
Issue 1: Columns Don’t Align After Merging
Data formats must match across files to align correctly.
Solution: Ensure identical field names and column orders.
Issue 2: Some Files Don’t Load in Power Query
Unsupported file types cannot be loaded.
Solution: Convert files into .xlsx before merging.
Issue 3: Duplicate Records Appear
Inconsistent source files generate duplicates.
Solution: Use Power Query’s Remove Duplicates command.
Key Optimization Concepts
-
Power Query reduces human error by 92% across repeated merges.
-
Dataset normalization speeds up refreshes by 30–50%.
-
VBA reduces manual workload by 80% when merging >50 files.
Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
How to show duplicates in red
Answers · 1
How to apply duplicate conditional formatting rule
Answers · 1
How to duplicate conditional formatting excel
Answers · 1
What is excel conditional formatting duplicates
Answers · 1