View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone[_2_] Jim Cone[_2_] is offline
external usenet poster
 
Posts: 1,549
Default Sort Order Doesn't Seem Correct

From the xl2003 help file...
"Default sort orders"...
"Apostrophes (') and hyphens (-) are ignored, with one exception: If two text strings are the same except for a hyphen,
the text with the hyphen is sorted last."

Not the way I would do it, but ...
--
Jim Cone
Portland, Oregon USA
http://www.contextures.com/excel-sort-addin.html




"Rich Locus"
wrote in message ...
Hello:
I have a program that sorts a text column and then does a sequence check to
make sure it is in ascending order so I can use a Vlookup using the option
where data must be in a sorted order.

Here is a snippet of the data where it doesn't sort correctly. The field is
defined as text. If you copy and paste this into a column you should have
the same strange results in that it doesn't sort it in ASCII order. The dash
character (Hex 2D) sorts AFTER the letter "K", which has a Hex code of "4B".
So it is not sorting correctly and my VLookup fails in that area.

Here's the data... try it for yourself:

1301932-DBKI/OL
1301932-DBKI/OL
1301932-DBKI/OL
1301932-DBKI/OL
1301932KI/OL
1301932KI/OL
1301932KI/OL
1301932KI/OL
1301932-LBKI/OL
1301932-LBKI/OL
1301932-LBKI/OL
1301932-LBKI/OL

The last 4 rows should be higher in the sorted data, not at the end.

Any help would be appreciated.

I have tried to sort using VBA and also just the regular user interface...
with the same results.

--
Rich Locus
Logicwurks, LLC