How to batch extract and merge multiple Excel worksheets into one file? XLSX spreadsheet consolidation tutorial


Translation:EnglishFrançaisDeutschEspañol日本語한국어
Update Time:2026-11-24 06:24:58
Content note: This article reflects the software version available when it was published. Interfaces and features may change with updates; please refer to the current software. If you find an error, please let us know.
Software featured in this articleHeSoft Doc Batch Tool
Free DownloadSoftware IntroductionUser Guide

When multiple Excel or XLSX files contain detail sheets, survey forms, or monthly reports with the same structure, opening each file and copying worksheets is not only time-consuming but also prone to missing data, repeated pasting, or retaining extra headers. This article uses HeSoft Doc Batch Tool as an example to introduce how to batch import multiple Excel files, extract worksheets by all, first few, last few, odd, even, or custom ranges, and consolidate the content into one worksheet or one workbook. It also explains how to retain header rows, set processing ranges, and check the results.

In daily office work, we often receive Excel files from different departments, stores, project teams, or survey respondents. The table structures of these files are roughly the same, but the data is saved separately in one or more worksheets across multiple xlsx files. If you need to create a summary table, the traditional approach is usually to open each Excel file one by one, locate the target worksheet, and then copy and paste the data into the summary file. This can still be handled when there are only a few files, but once the number grows to dozens or even hundreds, this method creates a large amount of repetitive work and may also lead to missed files, wrong worksheet selection, repeated header rows, and disordered data sequence.

This article introduces a processing method more suitable for batch office work: using HeSoft Doc Batch Tool to import many Excel files at once, batch extract worksheets within a specified range, and then merge the results into a single Excel file. The software can either vertically integrate data into one worksheet or collect the extracted worksheets into one workbook, making it suitable for handling common Excel spreadsheet files such as xlsx. The following sections will explain the effects before and after processing, the meaning of each parameter, and the complete operation process, with reference to the actual interface.

1. Applicable scenarios: which Excel files are suitable for batch extraction and merging

This function mainly solves the problem of centralized consolidation when multiple Excel files contain worksheets in the same position or with the same structure. As long as the files follow certain patterns, you can reduce the number of manual opening, copying, and pasting actions by batch-selecting the processing scope.

  • Survey questionnaire consolidation: each xlsx file stores a batch of survey data, and the target worksheets from each file need to be merged into one summary sheet.
  • Store or branch report integration: different stores separately submit daily, weekly, or monthly reports, and you need to batch extract the first few worksheets from each file and compile them centrally.
  • Financial and business detail archiving: multiple files contain income, expense, sales, or inventory details in the same format, and you want to integrate them into the same Excel file.
  • Centralized organization of project materials: project members submit separate workbooks, and you need to extract specified worksheets to avoid searching through each file individually.
  • Legacy spreadsheet migration: xls and xlsx files accumulated over many years are scattered in different locations, and you need to first extract them according to unified rules before forming a summary file that is easier to search and analyze.
  • Periodic repetitive tasks: the same Excel worksheet merging operation must be performed every week or month, and you want to use office software to reduce repetitive labor.

It should be noted that if you plan to merge all data into the same worksheet, the column structure, field order, and number of header rows in each source table should preferably remain consistent. For example, each table should contain fields such as number, category, name, quantity, and unit in the same order. The more consistent the structure, the more suitable the merged result will be for further filtering, sorting, creating pivot tables, or importing into other systems.

2. Result preview: obtaining one consolidated result from multiple XLSX files

1. Before processing: multiple Excel files saved separately

Before processing, there are 5 independent Excel files in the example folder, with file names 1.xlsx, 2.xlsx, 3.xlsx, 4.xlsx, and 5.xlsx. Each file needs to be included in this batch process. If done manually, you would need to open the files 5 times in succession and locate the worksheet to be extracted each time. In actual business scenarios with more files, the operation time would increase significantly.

image-Batch extract Excel worksheets,merge multiple Excel files into one,merge Excel worksheets,batch summarize XLSX,batch process Excel spreadsheets

The difficulty with this type of file lies not only in the large number of files, but also in the fact that each workbook may contain multiple worksheets. Users usually do not need to copy the entire workbook, but only want to extract all worksheets, the first few worksheets, the last few worksheets, or select them according to odd, even, and custom ranges. Therefore, the value of a batch tool is to allow all files to be processed under the same set of rules, eliminating the need to repeatedly perform the same actions.

2. After processing: data is concentrated into one Excel worksheet

After processing is complete, the target content scattered across multiple source files is consolidated into one Excel file. The example result shows that the data is concentrated in a worksheet named All_surveys, and the table content is arranged continuously for direct scrolling and viewing. In the screenshot, it can be seen that the merged data has already extended to many rows, and columns A through E maintain the table structure, facilitating subsequent statistics and analysis.

image-Batch extract Excel worksheets,merge multiple Excel files into one,merge Excel worksheets,batch summarize XLSX,batch process Excel spreadsheets

Compared with copying file by file, batch merging can significantly reduce window switching and repeated pasting. Especially when the first row of each worksheet contains the same field headers, using the function to keep only the unique header row can also prevent the same header from repeatedly appearing in the summary table, making the result cleaner.

3. Operation steps: batch extract Excel worksheets and merge them into one file

Step 1: enter the Excel tool and select the corresponding function

After opening HeSoft Doc Batch Tool , select Excel tools from the function categories on the left. The software focuses on batch processing of documents and office files, and can centralize repetitive file operations into one workflow. In the list of Excel tools, find and enter item 22, Extract Excel worksheets and merge them into one file.

image-Batch extract Excel worksheets,merge multiple Excel files into one,merge Excel worksheets,batch summarize XLSX,batch process Excel spreadsheets

From the function name, it can be seen that this tool is aimed at extracting and centrally merging worksheets from multiple Excel files, rather than simply placing the files into the same folder. After entering the function, the software guides the user through the task in the order of selecting records, setting processing options, setting the save location, and starting processing.

Purpose of this step: select the batch processing function that matches the requirement, and avoid mistakenly using tools with similar names but different processing logic, such as merging Excel files into one file or merging multiple worksheets into one worksheet.

Expected result: enter the task page for extracting Excel worksheets and merging them into one file, ready to add files to be processed.

Step 2: batch add the Excel files to be processed

After entering the task page, first add the source files. The upper right area of the interface provides two entry points: Add files and Import files from folder. If you only need to process a small number of spreadsheets scattered in different locations, you can use Add files. If many xlsx files are saved together in the same directory, using Import files from folder is usually more convenient.

In the example, 5 records from 1.xlsx to 5.xlsx have been successfully imported. The list also displays information such as name, path, extension, creation time, and modification time, and the summary area at the bottom shows that the number of records is 5. Before formally proceeding to the next step, you should verify the number and names of files to confirm that none are missing and that no irrelevant files have been added to the task. If a record does not need to be processed, you can remove it from the current list by clicking the delete icon in that row; if you need to reselect everything, you can use Clear.

image-Batch extract Excel worksheets,merge multiple Excel files into one,merge Excel worksheets,batch summarize XLSX,batch process Excel spreadsheets

When there are many files, you can also use the filtering and sorting functions in the interface to check the records. For example, after sorting by name, it is easier to visually confirm whether the numbering is continuous. After verification, click Next at the bottom of the page.

Purpose of this step: establish a source file list for this batch task so that the software can uniformly apply the subsequent rules to multiple Excel workbooks.

Expected result: all xlsx files from which worksheets need to be extracted appear in the record list, and the number of records matches the actual number of files.

Step 3: set the worksheet range to be extracted

After entering the processing options page, first select the processing scope. The interface provides options such as All worksheets, The first few worksheets, The last few worksheets, Odd worksheets, Even worksheets, and Custom. You should choose according to the positional pattern of the target worksheets in each source file.

In the example, The first few worksheets is selected, and 3 is entered in the range field, indicating that the first 3 worksheets from each Excel file should be extracted. If each file contains only one data sheet that needs to be consolidated, you can also set the corresponding range according to the actual structure. If you want to extract all worksheets in the workbook, select All worksheets. For cases where the distribution of target sheets is irregular, you can consider using the Custom option provided in the interface, but the specific range should be entered according to the actual file structure.

image-Batch extract Excel worksheets,merge multiple Excel files into one,merge Excel worksheets,batch summarize XLSX,batch process Excel spreadsheets

The range setting determines which worksheets will ultimately be processed, and it is one of the most important parameters in the entire task. It is recommended to first open one or two source files at random to check whether the worksheet order is consistent. If some files place the target sheet in the first position while others place it at the end, then uniformly selecting the first few worksheets may not produce a complete result. In that case, you should first organize the file structure or adopt a range rule that better matches the actual situation.

Purpose of this step: use the same rule to locate the target worksheets in each workbook and avoid extracting irrelevant pages.

Expected result: the software only processes worksheets that meet the range setting. For example, the example parameters will attempt to extract the first 3 worksheets from each source file.

Step 4: choose to merge into one worksheet or integrate into one workbook

In the integration method area, the interface provides two modes: Merge into one worksheet and Integrate into one workbook. Although both will generate a consolidated result, the organization method is different, so the choice should be made according to the subsequent purpose.

  • Merge into one worksheet: the extracted table contents are continuously consolidated into the same sheet. This is suitable for scenarios where the column structures of each worksheet are consistent and unified filtering, statistics, or chart creation is required. The post-processing result shown in this article is exactly the data concentrated in the All_surveys worksheet.
  • Integrate into one workbook: the extracted worksheets are centrally stored in one Excel workbook, but it does not emphasize joining all contents into a single sheet. This is suitable for scenarios where the relative independence of each table needs to be preserved.

In the example, Merge into one worksheet is selected. If your goal is to create a continuous summary data table, you can make the same choice. If you only want to reduce the number of files while still viewing different worksheets separately, you can choose Integrate into one workbook.

Purpose of this step: determine the structure in which the extracted Excel content will be saved.

Expected result: according to the selected mode, you will obtain either one continuous summary table or one centralized workbook containing multiple independent worksheets.

Step 5: set the header row retention rule

When multiple worksheets have the same header, directly joining them will often cause headers to repeat in the middle of the data. To improve this situation, the settings page provides the option to keep only the unique header row, and requires you to fill in how many rows at the beginning of all worksheets are headers.

In the example, Keep only the unique header row is enabled, and the number of header rows is set to 1, indicating that the first row of each worksheet is treated as the header. During merging, one header row is retained, and the duplicate header rows in other worksheets are not inserted repeatedly. This setting is suitable for cases where all source tables use the first row as field names.

If the actual files use a two-row composite header, you should enter 2 according to the real structure. If the beginning of the table also contains explanatory text, blank rows, or unit information, you need to first determine which rows should be considered as headers. An inaccurate header row count setting may cause body data to be skipped as headers, or cause duplicate headers to continue appearing in the summary result. Therefore, before executing a large batch task, it is recommended to test with a small number of files first.

Purpose of this step: reduce duplicate headers in the merged result and keep the data continuous.

Expected result: the summary worksheet retains only one set of required header rows, and the body data from subsequent source tables is appended in order.

Step 6: set the save location and start processing

After confirming that the processing options are correct, click Next and follow the wizard to enter the save location settings. It is recommended to save the output file to a separate results folder and not directly overwrite the original Excel files, so that you can readjust if the range or header row settings are unsuitable. Then enter the start processing stage and execute the batch extraction and merging task.

Since the interface wizard has clearly listed the two stages of setting the save location and starting processing, users only need to complete the output location settings according to the page prompts and then start processing. After the task is completed, open the generated Excel file and focus on checking the number of worksheets, total number of rows, header row, column order, and ending data to confirm that the result meets expectations.

Purpose of this step: specify the storage location of the result file and formally execute the batch task.

Expected result: the specified worksheets from multiple source Excel files are extracted, and a new Excel file is generated according to the selected integration method.

4. Preparation suggestions before processing

Batch processing can save a great deal of operation time, but the final result still depends on whether the source files are standardized. To reduce rework, it is recommended to complete the following checks before starting:

  1. Back up the original files: keep the source xlsx files in a separate directory, and save the output results to a new location.
  2. Confirm that the files can be opened normally: damaged, encrypted, or abnormal workbooks may affect processing and should be checked separately first.
  3. Verify the worksheet order: if you use the first few or last few worksheets, you must confirm that the arrangement rules of each file are basically consistent.
  4. Unify the field structure: when merging into one worksheet, you should try to ensure that the number of columns, column names, and field order are the same.
  5. Confirm the number of header rows: do not judge based on only one file; it is best to spot-check multiple source tables.
  6. Clean up temporary files: before importing an entire folder, first move away old result files, backup copies, or Excel files that should not be processed.

5. Common problems and precautions

1. Why do multiple groups of duplicate headers appear after merging?

This usually happens because Keep only the unique header row is not enabled, or the setting for how many rows at the beginning of all worksheets are headers does not match the actual situation. If the first row of each table contains the same field names, you can enable this option and enter 1. If there are two header rows, adjust it according to the actual situation.

2. Why does some required data not appear in the result?

First check the processing scope. In the example, the setting is the first 3 worksheets, so worksheets ranked fourth or later will not be extracted under this rule. If the target sheets are located at the end, in odd positions, or in different positions, you should switch to the corresponding option and verify the worksheet order in each file.

3. How to choose between merging into one worksheet and integrating into one workbook?

When you need to form a continuous summary table and perform unified statistics, choose Merge into one worksheet. When you need centralized storage but still want the worksheets to remain independent, choose Integrate into one workbook. Neither method is absolutely better; the key lies in the data structure and subsequent purpose.

4. Why may columns be misaligned after merging?

Batch merging does not automatically eliminate structural differences between source tables. If some worksheets have changed column order, added blank columns, or used different headers, the summary result may not be convenient for direct analysis. It is recommended to first unify the template and then perform batch extraction and merging.

5. Should all historical files be imported at once?

If you are using a set of data for the first time, it is recommended to select 2 to 5 representative files for a trial run. After confirming that the extraction range, header handling, and integration method are correct, import the complete folder. This can reduce the cost of reprocessing after incorrect settings in a large batch task.

6. Will file names affect the merge order?

The order in the file list is worth paying attention to. After importing, you can use the sorting function provided in the interface to organize the records and verify the order before processing. If business requirements require summarization by month, number, or department order, it is recommended to adopt a consistent and easily sortable file naming method in advance.

7. What should be checked after processing is complete?

At least check whether the generated file can be opened normally, whether the target worksheets are complete, whether the first header row is correct, whether the data rows are continuous, whether the data from the last source file is present, and whether the value and unit columns remain in their original positions. For important business data, you can also cross-check the record count in the source files with the summary result.

6. Summary

Batch extracting multiple Excel worksheets and merging them into one file is suitable for solving problems where there are many xlsx files, worksheet positions follow a pattern, and manual copying is time-consuming and error-prone. With HeSoft Doc Batch Tool , you can import multiple files at once, uniformly select all worksheets, the first few, the last few, odd, even, or custom worksheet ranges, and then decide whether to merge them into one worksheet or integrate them into one workbook, while reducing duplicate headers through the unique header row setting.

Compared with opening files one by one, this batch office method turns a large amount of repetitive clicking into a single parameter configuration, and is especially suitable for periodic reports, survey data, store details, and project material consolidation. In actual operation, it is recommended to first organize the source files and spot-check the table structure, then test the processing rules with a small number of files. After confirming that the result is correct, import the complete folder for batch execution. This can both improve the efficiency of Excel file organization and reduce the data risks caused by missed worksheet selection and repeated pasting.

Keyword:Batch extract Excel worksheets , merge multiple Excel files into one , merge Excel worksheets , batch summarize XLSX , batch process Excel spreadsheets
Creation Time:2026-11-24 06:24:42
Software featured in this articleHeSoft Doc Batch Tool
Free DownloadSoftware IntroductionUser Guide
Content note: This article reflects the software version available when it was published. Interfaces and features may change with updates; please refer to the current software. If you find an error, please let us know.