Nếu như bạn có nhiều File Excel mà muốn nối lại thành một File duy nhất . Ví dụ File A.XLS có 2 Sheet , File B.XLS có 3 Sheet muốn nối thành File C có 5 Sheet cách thức tiến hành như sau .
Dán những nội dung dưới đây
Dim FilesToOpen
Dim x As Integer
Application.ScreenUpdating = False
(FileFilter:="Microsoft Excel Files (*.xls), *.xls", MultiSelect:=True, Title:="Files to Merge")
MsgBox "No Files were selected"
GoTo ExitHandler
End If
While x <= UBound(FilesToOpen)
Workbooks.Open Filename:=FilesToOpen(x)
Sheets().Move After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
x = x + 1
Wend
Application.ScreenUpdating = True
Exit Sub
MsgBox Err.Description
Resume ExitHandler
End Sub