新建一个工作薄,将所有EXCEL表的文件名填到A列中,复制下面VBA代码到工作薄中,保存为excel.xls后执行
Sub xlscopy()
Application.ScreenUpdating = False
'Arr数组由所有EXCEL文件名组成
arr = [A1:A10]
For i = 1 To UBound(arr)
Workbooks.Open "文件夹路径\" & arr(i, 1)
Workbooks(arr(i)(1)).Activate
For j = 1 To ActiveWorkbook.Sheets.Count
Sheets(j).Copy After:=Workbooks("excel.xls").Sheets(Workbooks("excel.xls").Sheets.Count)
Next
Workbooks(arr(i, 1)).Close False
Next
End Sub
温馨提示:答案为网友推荐,仅供参考