08-03-22, 06:38 PM
كود :
Dim poss As Integer = DataGridView2.CurrentRow.Index
Dim posNN = DataGridView2.Rows(poss).Cells(0).Value
Dim posPP = DataGridView2.Rows(poss).Cells(3).Value
Dim xx1,xx2 as string
Try
For i = 0 To DataGridView1.Rows.Count - 1
Dim x(DataGridView1.ColumnCount) As String
For ii = 0 To DataGridView1.ColumnCount
Try
x(ii) = DataGridView1.Rows(i).Cells(ii).Value.ToString
Application.DoEvents()
Catch
End Try
Next
Application.DoEvents()
If x(0) = posNN Then
xx1 = x(6)
End If
Next
Catch ex As Exception
End Try
xx2 = val(posPP) - val(xx1)