Hi Steve,
Ah okay, I see what you mean now with respect to the example you gave in your first post.
Comparison operators can perform both numeric and string comparisons, but these comparisons can yield different results. Generally speaking, you're best off comparing numbers as numbers rather than numbers as strings. I'll give a different example just to illustrate this -
Sub testIt()
Const dblNUMBER1 As Double = 5.5
Const dblNUMBER2 As Double = 100.5
'this returns False because > is performing a numeric comparision
Debug.Print dblNUMBER1 > dblNUMBER2
'this returns True because > is performing a string comparision
Debug.Print CStr(dblNUMBER1) > CStr(dblNUMBER2)
End Sub
So just something to watch out for...
Bookmarks