Đất Bắc Ninh không nhiều đá vôi bằng Ninh Bình. Qua bên Ninh Bình hy vọng dân ở đó nhiều "cao nhơn" hơn.
Còn muốn kiếm cao hổ cốt, cao khỉ thì nên lên Lạng Sơn.
Bác nào code giúp đoạn này thành copy từ dòng số 3, sheet 4 sau đó paste special, value vào báo cáo tổng với ạ. Thanks!
Sub MergeFilesExcel()
Dim path As String, ThisWB As String, lngFilecounter As Long
Dim wbDest As Workbook, shtDest As Worksheet, ws As Worksheet
Dim Filename As String, Wkb As Workbook
Dim CopyRng As Range, Dest As Range
Dim RowofCopySheet As Integer
RowofCopySheet = 2
ThisWB = ActiveWorkbook.Name
'Dien duong dan folder chua cac tap tin excel can gom lai.
'Nhu ban thay toi tien duong dan thu muc chua cai file excel cua toi.
path = "C:\Users\DAT\Desktop\New folder (2)"
Application.EnableEvents = False
Application.ScreenUpdating = False
Set shtDest = ActiveWorkbook.Sheets(1)
Filename = Dir(path & "\*.xls", vbNormal)
If Len(Filename) = 0 Then Exit Sub
Do Until Filename = vbNullString
If Not Filename = ThisWB Then
Set Wkb = Workbooks.Open(Filename:=path & "\" & Filename)
Set CopyRng = Wkb.Sheets(1).Range(Cells(RowofCopySheet, 1), Cells(ActiveSheet.UsedRange.Rows.Count, ActiveSheet.UsedRange.Columns.Count))
Set Dest = shtDest.Range("A" & shtDest.UsedRange.SpecialCells(xlCellTypeLastCell).Row + 1)
CopyRng.Copy Dest
Wkb.Close False
End If
Filename = Dir()
Loop
Range("A1").Select
Application.EnableEvents = True
Application.ScreenUpdating = True
MsgBox "Ket Thuc!"
End Sub