Sub LoopThroughFilesV3()
Dim SourceDirectory As String, SourcefileName As String, DestinationSheetName As String, SourceSheetName As String
Dim DestinationRow As Long, MyCell As Range
'
Application.ScreenUpdating = False
DestinationRow = 1 ' <--- Set this to the top row for the results
'
SourceDirectory = "c:\Users\US\Desktop\S1\"
'
SourceSheetName = "D1" ' <--- Set this to the Source Sheet Name that will always be used
DestinationSheetName = "Sheet1" ' <--- Set this to the Destination Sheet Name
SourcefileName = Dir(SourceDirectory & "*.xlsx") ' Save source file name
Do While SourcefileName <> ""
Set MyCell = ThisWorkbook.Sheets(DestinationSheetName).Cells(DestinationRow, "A")
MyCell.Offset(, 0).Formula = "='" & SourceDirectory & "[" & SourcefileName & "]" & SourceSheetName & "'!B5"
MyCell.Offset(, 1).Formula = "='" & SourceDirectory & "[" & SourcefileName & "]" & SourceSheetName & "'!H7"
MyCell.Offset(, 2).Formula = "='" & SourceDirectory & "[" & SourcefileName & "]" & SourceSheetName & "'!F19"
MyCell.Offset(, 3).Formula = "='" & SourceDirectory & "[" & SourcefileName & "]" & SourceSheetName & "'!F20"
MyCell.Offset(, 4).Formula = "='" & SourceDirectory & "[" & SourcefileName & "]" & SourceSheetName & "'!F21"
MyCell.Resize(1, 5).Value = MyCell.Resize(1, 5).Value
DestinationRow = DestinationRow + 1
SourcefileName = Dir
Loop
'
Application.ScreenUpdating = True
End Sub