Try
Sub test()
Dim wb As Workbook
Dim ws As Worksheet
Dim mRng As Range
Dim cRng As Range
Dim mCell As Range
Dim cCell As Range
Dim filename As String
Dim folderPath As String
Set Mwb = ActiveWorkbook
Set mws = Worksheets(1)
lr = ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row
Set mRng = mws.Range("h1:h" & lr)
folderPath = "C:\Data\"
file = Dir(folderPath)
Application.ScreenUpdating = False
While (file <> "")
Set wb = Workbooks.Open(folderPath & file)
Set ws = wb.Worksheets(1)
lr = ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row
Set cRng = ws.Range("H1:H" & lr)
For Each Cell In cRng
If IsNumeric(Cell.Offset(0, 1)) Then
res = Application.Match(Cell, mRng, 0)
If Not IsError(res) Then
mws.Cells(res, "I") = Cell.Offset(0, 1)
End If
End If
Next Cell
Workbooks(file).Close SaveChanges:=False
file = Dir
Wend
Application.ScreenUpdating = True
End Sub
Bookmarks