Install in seconds
Install this skill
Copy the command and run it in your terminal. You can review the source before installing.
terminal
git clone https://github.com/CoderWanFeng/python-office

Works with Git. The repository opens in your current directory.

📋
DataPython

Merge to Sheet

by CoderWanFeng

A Python utility that merges all sheets from multiple Excel files into a single sheet. Useful for consolidating data from various workbooks into one unified table.

1.3K stars297 forksAdded 2026/07/20
officepippypipythonweixin

Documentation

README

merge2sheet Skill

自动合并多个 Excel 文件的多个 sheet

功能描述

将多个 Excel 文件中的所有 sheet 合并到同一个 Excel 文件的同一个 sheet 中。

所属分类

office/skills/excel/merge2sheet/

调用方式

from office.skills.excel import merge2sheet

merge2sheet(
    dir_path='./excels',
    output_sheet_name='Sheet1',
    output_excel_name='merge2sheet'
)

参数说明

参数 类型 必填 默认值 说明
dir_path str - 包含多个 Excel 文件的目录路径
output_sheet_name str 'Sheet1' 合并后的 sheet 名称
output_excel_name str 'merge2sheet' 合并后的 Excel 文件名

返回值

None

使用示例

from office.skills.excel import merge2sheet
merge2sheet(dir_path='./my_excels', output_sheet_name='AllData', output_excel_name='all_merged')

原始函数

office.api.excel.merge2sheet