Sharmastic
New Member
- Joined
- Dec 17, 2012
- Messages
- 3
Hi,
i'm having a problem with the <> (not Equal) giving the wrong answer,
i have 2 values that are both identical in every way i can find except the <> says they are different,
in excel watch both values are displayed as Type Variant/Double and both = 0.47 and yet the following code says they are different,
If Application.RoundUp(Cells(RowID, "Q"), 2) <> Application.RoundUp((Cells(RowID, "G") * 1.1 * (1 + (Cells(RowID, "E") / 100))), 2) Then
it basically checks that the price is correct by using the Cost (Cells(RowID, "G"))) adding 10% then adding any Vat ((Cells(RowID, "E")) which matches the value in Cells(RowID, "Q"),
They both display as identical in the Watch window and the same Type (Variant/Double) and yet the Macro is adamant they are both different?????
the if statement returns True, if i change the <> to = it comes up as false. is there anything i'm missing that i should check to try and find a differance??
it does this with about 7000 out of 30000 checks and i carn't figure out why.
Many thanks in advance for any help,
i'm having a problem with the <> (not Equal) giving the wrong answer,
i have 2 values that are both identical in every way i can find except the <> says they are different,
in excel watch both values are displayed as Type Variant/Double and both = 0.47 and yet the following code says they are different,
If Application.RoundUp(Cells(RowID, "Q"), 2) <> Application.RoundUp((Cells(RowID, "G") * 1.1 * (1 + (Cells(RowID, "E") / 100))), 2) Then
it basically checks that the price is correct by using the Cost (Cells(RowID, "G"))) adding 10% then adding any Vat ((Cells(RowID, "E")) which matches the value in Cells(RowID, "Q"),
They both display as identical in the Watch window and the same Type (Variant/Double) and yet the Macro is adamant they are both different?????
the if statement returns True, if i change the <> to = it comes up as false. is there anything i'm missing that i should check to try and find a differance??
it does this with about 7000 out of 30000 checks and i carn't figure out why.
Many thanks in advance for any help,
Last edited: