1. 新建excel文件
2. 在工作表标签右键,查看代码
3. VBA代码
Sub 工作薄间工作表合并()Dim FileOpenDim X As IntegerApplication.ScreenUpdating = FalseFileOpen = Application.GetOpenFilename(FileFilter:="Microsoft Excel文件(.xlsx),.xlsx", MultiSelect:=True, Title:="合并工作薄")X = 1While X <= UBound(FileOpen)Workbooks.Open Filename:=FileOpen(X)Sheets().Move After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)X = X + 1WendExitHandler:Application.ScreenUpdating = TrueExit Suberrhadler:MsgBox Err.DescriptionEnd Sub
4. 关闭VBA编辑窗
5. 执行宏
6. 选择需要合并的文件
7. 执行结果
每个文件会复制到汇总文件的单独工作表中
