وعليكم السلام
جرب الكود التالي عله يفي بالغرض إن شاء الله
CODE
Sub Test()
Dim x, y, ws1 As Worksheet, ws2 As Worksheet, sh As Worksheet, lr As Long, i As Long
Application.ScreenUpdating = False
Set sh = ThisWorkbook.Worksheets(1)
Set ws1 = ThisWorkbook.Worksheets(2)
Set ws2 = ThisWorkbook.Worksheets(3)
lr = sh.Cells(Rows.Count, "B").End(xlUp).Row
With sh.Range("C2:O" & lr)
.ClearContents: .Borders.Value = 0
End With
sh.Columns(14).NumberFormat = "#"
For i = 2 To lr
x = Application.Match(sh.Cells(i, 2).Value, ws1.Columns(1), 0)
If Not IsError(x) Then
sh.Cells(i, 3).Value = ws1.Cells(x, 3).Value
sh.Cells(i, 4).Value = ws1.Cells(x, 6).Value
sh.Cells(i, 6).Value = ws1.Cells(x, 5).Value
sh.Cells(i, 7).Value = ws1.Cells(x, 7).Value
sh.Cells(i, 8).Value = ws1.Cells(x, 9).Value
sh.Cells(i, 13).Value = ws1.Cells(x, 10).Value
sh.Cells(i, 14).Value = ws1.Cells(x, 8).Value
End If
y = Application.Match(sh.Cells(i, 2).Value, ws2.Columns(2), 0)
If Not IsError(y) Then
sh.Cells(i, 9).Value = ws2.Cells(y, 4).Value
sh.Cells(i, 10).Value = ws2.Cells(y, 6).Value
sh.Cells(i, 11).Value = ws2.Cells(y, 5).Value
sh.Cells(i, 12).Value = ws2.Cells(y, 7).Value
sh.Cells(i, 15).Value = ws2.Cells(y, 8).Value
End If
Next i
With sh.Range("B2:O" & lr)
.Borders.Value = 1
End With
Application.ScreenUpdating = True
End Sub