Hướng dẫn gộp nhiều file excel thành 1 file

9 1.9K 4
Hướng dẫn gộp nhiều file excel thành 1 file

Đang tải... (xem toàn văn)

Thông tin tài liệu

Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file Hướng dẫn gộp nhiều file excel thành 1 file

Hướng dẫn gộp nhiều file Excel thành File Bài viết hướng dẫn chi tiết cách gộp nhiều file Excel thành file Ví dụ có file liệu sau: File tên DS_1 có nội dung: File tên DS_2 có nội dung: Muốn tổng hợp liệu từ file thành file liệu đặt tên Book1 (các ghi nằm Sheet) bạn làm sau: Bước 1: Tạo file Excel tên Book1 -> nhấn tổ hợp phím Alt + F11 -> cửa sổ xuất -> Chọn thẻ Insert ->Module Bước 2: Copy toàn đoạn code sau vào Module Sub GopFileExcel() Dim FilesToOpen Dim x As Integer On Error GoTo ErrHandler Application.ScreenUpdating = False FilesToOpen = Application.GetOpenFilename _ (FileFilter:="Microsoft Excel Files (*.xlsx), *.xlsx", MultiSelect:=True, Title :="Files to Merge") If TypeName(FilesToOpen) = "Boolean" Then MsgBox "No Files were selected" GoTo ExitHandler End If x = While x Module Bước 5: Copy toàn đoạn code sau vào module -> lưu lại đặt tên GopCacSheet () Sub GopCacSheet() Dim Sh As Worksheet Application.ScreenUpdating = False [A6].CurrentRegion.Offset(1, 1).ClearContents For Each Sh In Worksheets If Sh.Name "Gop_File" Then With [B65500].End(xlUp).Offset(1) [A6].CurrentRegion.Offset(1, 1).Copy Destination:=.Offset(0) End With End If Next Sh Application.ScreenUpdating = True Columns("E:E").Hidden = False: Randomize [A5].Resize(, 6).Interior.ColorIndex = 34 + * Rnd() \ End Sub Bước 6: Quay trở lại File Excel vừa tạo -> Vào thẻ View -> View Marco Bước 7: Hộp thoại macro xuất -> chọn module (tên GopFileExcel ()) -> Run Bước 8: Hộp thoại Browse xuất chọn đường dẫn tới file liệu cần gộp (ở file DS_1 DS_2) ->Open Sau chọn Open liệu từ file tương ứng ghi vào sheet sheet file Book1 Việc cuối gộp Sheet thành Sheet Bước 9: Vào thẻ View -> View Macro -> GopCacSheet () -> Run Tất liệu Sheet gộp vào Sheet Lưu ý số thứ tự chưa bạn cần nhập lại chỉnh kích thước cột Sau chỉnh sửa kết quả: Chú ý: - Sheet gộp sheet2, sheet sheet - Áp dụng với số lượng file khác lưu ý số file lớn tốc độ xử lý chậm - Trong trình gộp file liệu không nên sử dụng hàm liệu gây lỗi (vì địa thay đổi) Nên dùng liệu nhập đơn ... Sub GopFileExcel() Dim FilesToOpen Dim x As Integer On Error GoTo ErrHandler Application.ScreenUpdating = False FilesToOpen = Application.GetOpenFilename _ (FileFilter:="Microsoft Excel Files... lại File Excel vừa tạo -> Vào thẻ View -> View Marco Bước 7: Hộp thoại macro xuất -> chọn module (tên GopFileExcel ()) -> Run Bước 8: Hộp thoại Browse xuất chọn đường dẫn tới file liệu cần gộp. .. chọn đường dẫn tới file liệu cần gộp (ở file DS _1 DS_2) ->Open Sau chọn Open liệu từ file tương ứng ghi vào sheet sheet file Book1 Việc cuối gộp Sheet thành Sheet Bước 9: Vào thẻ View -> View

Ngày đăng: 06/01/2017, 11:25

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan