السلام عليكم ورحمة الله
انسخ هذا الكود فى موديول جديد وخصص له زر
Sub SecNim()
Dim R As Integer, S As Integer
Z = 0
Range("M7:M250").ClearContents
For S = 7 To 13
For R = 7 To Range("K" & Rows.Count).End(xlUp).Row
If Cells(R, "L") >= Cells(S, "E") And Cells(R, "L") <= Cells(S, "F") Then
Z = Z + 1
Cells(R, "M") = Cells(S, "G") + Z - 1
End If
Next
Z = 0
Next
End Sub