I would like to compare two cells and it should display "OK" or "NOT OK".
When I used an excel formula, it worked properly.
However when I tried it using VBA, I am not getting the correct results.
Below is a simpler example of my data:
Fee1 | Fee2 |
---|---|
0.009 | 0.009 |
To note that in my worksheet, Fee1 is generated via a VBA vlookup function and Fee2 is generated via a case statement VBA code.
My code is as per below:
If Range("L2") <> Range("M2") Then
Range("N2").Value = "NOT OK"
Else
Range("N2").Value = "OK"
End If
Debug.Print Range("N2")
Debug.Print Range("L2")
Debug.Print Range("m2")
I used debug print to check and got the results below:
NOT OK
0.009
0.009
I am perplexed at what i am doing wrong.