I am trying to compare data between two columns (C57BL/6J REF) and (DBA/2J REF) against column (F64870). When I write if condition if the first statement is true it should stop the iteration and if statement is false it should go to elseif condition. But once I execute the code my results are not correct.
Sub getData()
Dim i As Long
Dim j As Long
Dim lastRow As Long
Dim data As Boolean
lastRow = Cells(Rows.Count, "A").End(xlUp).Row
j = 4
data = False
For i = 3 To lastRow
If Sheet1.Range("_C57BL_6J_REF").Cells(i, j) = Cells(i, j) Then
Cells(i, j) = "A"
data = True
ElseIf Sheet1.Range("DBA_2J_REF").Cells(i, j) = Cells(i, j) Then
Cells(i, j) = "B"
data = True
ElseIf Range("_C57BL_6J_REF").Cells(i, j) = "N" And Sheet1.Range("DBA_2J_REF").Cells(i, j) = "N" Then
Cells(i, j) = "P"
End If
Next i
End Sub
C57BL/6J REF DBA/2J REF F64870 Expected result What I got
T C T A B C C C A A T T T A A A A A A A A A A A A C C C A A N N G P B N N N P P N N C P A N N N P P N N C P C N N C P A N N N P P N N N P P N N N P P N N N P P
Aucun commentaire:
Enregistrer un commentaire