1、需要把多个excel表都放在同一个文件夹里面,并在这个文件夹里面新建一个excel。如图所示。2、打开新建的excel表,并右键单击sheet1,找到“查看代码”,单击进去。进去之后就看到了宏计算界面。如图所示。3、然后把下面这些宏计算的代码复制进去,然后找到工具栏上面的“运行”下的“运行子过程/用户窗体”,代码如下,如图所示:Sub 合并当前目录下所有工作簿的全部工作表()Dim MyPath, MyName, AWbNameDim Wb As Workbook, WbN As StringDim G As LongDim Num As LongDim BOX As StringApplication.ScreenUpdating = FalseMyPath = ActiveWorkbook.PathMyName = Dir(MyPath & \ & *.xls)AWbName = ActiveWorkbook.NameNum = 0Do While MyName If MyName AWbName ThenSet Wb = Workbooks.Open(MyPath & \ & MyName)Num = Num + 1With Workbooks(1).ActiveSheet.Cells(.Range(B65536).End(xlUp).Row + 2, 1) = Left(MyName, Len(MyName) - 4)For G = 1 To Sheets.CountWb.Sheets(G).UsedRange.Copy .Cells(.Range(B65536).End(xlUp).Row + 1, 1)NextWbN = WbN & Chr(13) & Wb.NameWb.Close FalseEnd WithEnd IfMyName = DirLoopRange(B1).SelectApplication.ScreenUpdating = TrueMsgBox 共合并了 & Num & 个工作薄下的全部工作表。如下: & Chr(13) & WbN, vbInformation, 提示End Sub4、运行之后,等待10秒针左右,等运行完毕,就是合并完成之后,会有提示,点确定就可以了。