Hi Hobbiton73
Try this code
Sub MergeOriginal()
Dim DestWB As Workbook, WB As Workbook, WS As Worksheet, SourceSheet As String
Dim StartRow As Long, dR As Long, LastRow As Long
Dim Fd As FileDialog, sPath As String, sFile As String
Set DestWB = ActiveWorkbook
SourceSheet = "Input"
StartRow = 2
' Select the folder that contains the files
Set Fd = Application.FileDialog(msoFileDialogFolderPicker)
With Fd
'.InitialFileName = "DefaultPath"
If .Show = -1 Then
sPath = Fd.SelectedItems(1) & "\"
End If
End With
Set Fd = Nothing
' Directory in the folder
sFile = Dir(sPath)
Do While sFile <> ""
Set WB = Workbooks.Open(Filename:=sFile, ReadOnly:=True)
For Each WS In WB.Worksheets
If WS.Name = SourceSheet Then
With WS
If .UsedRange.Cells.Count > 1 Then
dR = DestWB.Worksheets("Time Recording").Range("B" & DestWB.Worksheets("Time Recording").Rows.Count).End(xlUp).Row + 1
If dR < 5 Then dR = 6 'destination start row
LastRow = .Range("A" & Rows.Count).End(xlUp).Row
If LastRow >= StartRow Then
.Range("A" & StartRow & ":M" & LastRow).Copy
DestWB.Worksheets("Time Recording").Cells(dR, "B").PasteSpecial xlValues
DestWB.Worksheets("Time Recording").Range("B5:N" & LastRow).Font.Name = "Lucida Sans"
DestWB.Worksheets("Time Recording").Range("B5:N" & LastRow).Font.Size = 10
DestWB.Worksheets("Time Recording").Range("K5:N" & LastRow).NumberFormat = "#,##0.00"
DestWB.Worksheets("Time Recording").Range("K5:N" & LastRow).HorizontalAlignment = xlCenter
End If
End If
End With
Exit For
End If
Next WS
WB.Close savechanges:=False
' Next file in folder
sFile = Dir
Loop
End Sub
See you later
Bookmarks