This works for me...
For Each dr As DataGridViewRow In grdFloppy.Rows
For Each dr2 As DataGridViewRow In grdFloppy.Rows
If dr2.Index > dr.Index Then
checkExists(dr, dr2)
End If
Next
Next
Private Sub checkExists(ByVal dr As DataGridViewRow, _
ByVal dr2 As DataGridViewRow)
If dr.Cells(3).Value.ToString = dr2.Cells(3).Value.ToString And _
dr.Cells(4).Value.ToString = dr2.Cells(4).Value.ToString And _
dr.Cells(0).Value.ToString = dr2.Cells(0).Value.ToString Then
For Each drow As DataGridViewRow In grdFloppy1.Rows
If drow.Cells(3).Value.ToString = dr.Cells(3).Value.ToString And _
drow.Cells(4).Value.ToString = dr.Cells(4).Value.ToString And _
drow.Cells(0).Value.ToString = dr.Cells(0).Value.ToString Then
Exit Sub
End If
Next
grdFloppy1.Rows.Add(New Object() {dr.Cells(0).Value, dr.Cells(1).Value, _
dr.Cells(2).Value, dr.Cells(3).Value, _
dr.Cells(4).Value})
End If
End Sub