Something I just found. Can someone replicate or explain what I am doing wrong?
In cell A1, put “Wal-mart”
in cell A2 put “Walmart”
Sort these two cells in ascending order. “Walmart” goes to the top.
In a module, enter the following code:
Sub testhyphen() If Range("a1").Value > Range("a2").Value Then Debug.Print "Greater" Else Debug.Print "Less Than" End If End Sub
When I run this code it tell me that “Walmart” is greater than “Wal-mart,” which is the exact opposite of how it sorts.
Is this a bug, or does it have rational explanation, or am I just missing something here? Makes me wonder if there are other sorting/comparison anomalies out there.
Ken