PLEASE help
You don't say what to do with the determination, so perhaps you can adjust
this. Although you don't say what to do if F is exactly 10
Sub AABBCC()
For i = 2 To 202
Set rngF = Cells(i, "F")
Set rngG = Cells(i, "G")
Set rngD = Cells(i, "D")
Set rngD1 = Cells(i + 1, "D")
Set rngE = Cells(i + 1, "E")
If rngF 10 And rngG = rngD Then
res = "OK"
ElseIf (rngF 10 And rngG < rngD) Then
res = "Not OK"
ElseIf (rngF < 10 And rngE = rngD1) Then
res = "OK"
ElseIf (rngF < 10 And rngE < rngD1) Then
res = "Not OK"
Else
res = "anomaly"
End If
MsgBox "row: " & i & " result: " & res
Next
End Sub
--
Regards,
Tom Ogilvy
"Gale" wrote in message
...
How do I write this as a macro for 200 different rows?
If F2 is 10 or more, and G2 is = D2, THEN OK
If F2 is 10 or more, and G2 is < D2, THEN NOT OK
If F2 is <10, and E3 is = D3, THEN OK
If F2 <10, and E3 is < D3, THEN NOT OK
Thanks so much if you can figure this out!! :)
|