I'm triying to calculate the datagridview in the attachment by this code:
Code:Dim PAEasayuk1 As Double Dim PAEasayuk2 As Double Dim PAEasayuk As Double For PAEasa1 As Integer = 0 To DataGridView1.RowCount - 1 For PAEasa2 As Integer = 1 To DataGridView1.RowCount - 1 For PAEasa3 As Integer = 1 To DataGridView1.RowCount - 1 PAEasayuk1 = DataGridView1.Rows(PAEasa1).Cells(0).Value PAEasayuk2 = DataGridView1.Rows(PAEasa2).Cells(1).Value If PAEasayuk2 > PAEasayuk1 Then PAEasayuk = 1 Else PAEasayuk = -1 DataGridView1.Rows(PAEasa3).Cells(1).Value = PAEasayuk Next Next Next
End of calculation all results are 1 or -1 . But, I want if it is big 1, otherwise -1
Thanks for the answers.




Reply With Quote
