you can use the decimal data type if you want to avoid this type of behavior. The following changes make the code snippet work:
VB Code:
Dim bb As Double Dim aa As Double aa1 = 1.36 aa2 = 0.04 aa = aa1 + aa2 bb = 1.4 If CDec(aa) > CDec(bb) Then MsgBox aa & ">" & bb ElseIf CDec(aa) = CDec(bb) Then MsgBox aa & "=" & bb Else MsgBox aa & "<" & bb End If




Reply With Quote