جرب الكود
Sub ragab()
Application.ScreenUpdating = False
Dim R As Integer, M As Integer
Sheets("ناجح").Range("B5:K4000").ClearContents
Sheets("راسب").Range("B5:K4000").ClearContents
M = 6: N = 6
For R = 6 To 400
If Cells(R - 3, 4).Value = "ناجح" Then
Cells(R - 3, "C").Resize(, 2).Copy
Sheets("ناجح").Range("B" & M).PasteSpecial xlPasteValues
Application.CutCopyMode = False
M = M + 1
ElseIf Cells(R - 3, 4).Value = "راسب" Then
Cells(R - 3, "C").Resize(, 2).Copy
Sheets("راسب").Range("B" & M).PasteSpecial xlPasteValues
Application.CutCopyMode = False
N = N + 1
End If
Next
Application.ScreenUpdating = True
End Sub