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:
  1. Dim bb As Double
  2.  
  3. Dim aa As Double
  4.  
  5. aa1 = 1.36
  6. aa2 = 0.04
  7.  
  8. aa = aa1 + aa2
  9.  
  10. bb = 1.4
  11.  
  12.  
  13. If CDec(aa) > CDec(bb) Then
  14. MsgBox aa & ">" & bb
  15. ElseIf CDec(aa) = CDec(bb) Then
  16. MsgBox aa & "=" & bb
  17. Else
  18. MsgBox aa & "<" & bb
  19. End If