السلام عليكم
هذا التعديل
Sub دور_ثاني()
Test_1 = "دور ثان"
Test_2 = "لها ور ثانٍ فى"
HidMyRow Test_1, Test_2
End Sub
Sub الناجحين()
Test_1 = "ناجح"
Test_2 = "نـاجـــــــحة"
HidMyRow Test_1, Test_2
End Sub
Sub الغايبين()
Test_1 = "غائب"
Test_2 = "نـاجـــــــحة"
HidMyRow Test_1, Test_2
End Sub
Sub HidMyRow(Test_1, Test_2)
MyCol = 28
MyCol2 = 10
Application.ScreenUpdating = False
Rows.Hidden = False
Serial = 0
For MyRow = 10 To 34
ChkMy = Cells(MyRow, MyCol)
ChkMyNum = Cells(MyRow, MyCol2)
If ChkMy <> Test_1 And ChkMy <> Test_2 Or ChkMyNum = "" Then
Rows(MyRow).Hidden = True
Else
Serial = Serial + 1
Cells(MyRow, 3) = Serial
End If
Next
Application.ScreenUpdating = True
End Sub
Sub ShowAll()
Application.ScreenUpdating = False
Rows.Hidden = False
Range("B6:B7").ClearContents
MyCol2 = 4
For MyRow = 10 To 34
ChkMyNum = Cells(MyRow, MyCol2)
If ChkMyNum <> "" Then
Cells(MyRow, 3) = MyRow - 5
End If
Next
Application.ScreenUpdating = True
End Sub