多个工作簿合并成一个工作簿中的多个sheet
Sub 多表多文件合并为多表一文件()
Dim FileArray
Dim X As Integer
Application.ScreenUpdating = False
FileArray = Application.GetOpenFilename(FileFilter:="Microsoft Excel文件(*.xlsx),*.xlsx", MultiSelect:=True, Title:="合并工作薄")
X = 1
While X <= UBound(FileArray)
Workbooks.Open Filename:=FileArray(X)
Sheets().Move After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
X = X + 1
Wend
ExitHandler:
Application.ScreenUpdating = True
Exit Sub
errhadler:
MsgBox Err.Description
End Sub