11-11-24, 01:24 PM
كود :
For i As Integer = 0 To DataGridView1.Rows.Count - 1
Dim currentNumber As Integer = Convert.ToInt32(DataGridView1.Rows(i).Cells(6).Value)
Dim count As Integer = 0
' احسب عدد التكرارات في الصفوف السابقة
For j As Integer = 0 To i - 1
If Convert.ToInt32(DataGridView1.Rows(j).Cells(6).Value) = currentNumber Then
count += 1
End If
Next
' ضع العدد في العمود الثامن
DataGridView1.Rows(i).Cells(7).Value = count
Next
