I tried this code but didn't work. What is the mistake.
[VBA]Dim i As Long
Dim LastRow2 As Long
Dim LastRow3 As Long
Dim TargetRow As Long
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
With Worksheets("Sheet1")
LastRow2 = .Cells(.Rows.Count, "D").End(xlUp).Row
End With
With Worksheets("Material")
LastRow3 = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To LastRow3
TargetRow = 0
On Error Resume Next
TargetRow = .Evaluate("MATCH(1,(sheet1!D1" & LastRow2 & "=D" & i & ")*" & _
"(sheet1!E1:E" & LastRow2 & "=E" & i & ")*" & _
"(sheet1!F1:F" & LastRow2 & "=F" & i & ")*" & _
"(sheet1!G1:G" & LastRow2 & "=G" & i & "),0)")
On Error GoTo 0
If TargetRow > 0 Then
Worksheets("sheet1").Cells(TargetRow, "I").Resize(, 2).Copy .Cells(i, "F")
End If
Next i
End With
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With[/VBA]