View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Suh, Suk Ho Suh, Suk Ho is offline
external usenet poster
 
Posts: 5
Default Comparing Values for Sorting

Dear Colleagues;

How do I sort an array containing the following string values?

I tried using Strcmp function and < comparison to compare each elements,
but the results don't look as I expected. for example if I compare 030814-01
with 030811-02, Strcomp renders a reverse result. But when I paste this
value into a sheet the Sort works ok. So, I'm lost.

Any guidances will be most appreciated.


from this

030814-01
030409-01-R1
030821-01
030731-01
030821-02
030613-01
030613-01R1
030821-02R1
030811-01R1
030823-01
030811-02

to this

030409-01-R1
030613-01
030613-01R1
030731-01
030811-01R1
030811-02
030814-01
030821-01
030821-02
030821-02R1
030823-01

Suk Ho