Hi, fatalcore,
did you delete the contents from cell G2 and run patel45īs code? According to your opening post:
But if the cell is blank (that means no team) then the code will not change the cell value in Column C.
Sub shortened_a()
Dim lngCounter As Long
For lngCounter = 2 To Cells(Rows.Count, "A").End(xlUp).Row
If Not IsEmpty(Range("G" & lngCounter).Value) Then
Range("C" & lngCounter).Value = IIf(Range("G" & lngCounter).Value = Range("G2").Value, "Passed", "Retest on next sample")
End If
Next lngCounter
End Sub
Sub shortened_b()
Dim lngCounter As Long
For lngCounter = 2 To Cells(Rows.Count, "A").End(xlUp).Row
If Not IsEmpty(Range("G2").Value) Then
Range("C" & lngCounter).Value = IIf(Range("G" & lngCounter).Value = Range("G2").Value, "Passed", "Retest on next sample")
End If
Next lngCounter
End Sub
@Winon:
I agree on using a formula. 
Ciao,
Holger
Bookmarks