How to code a macro to sort a list of string?

E

Eric

In cell A2, there is char 2328050010001023841.
The format for those value must be string instead of number based on Excel's
specifications,
which has 15 digit precision.

If I get a list of string under A column, does anyone have any suggestions
on how to sort it in ascending order based on macro coding?
Thank everyone very much for any suggestions
Eric
 
P

Per Jessen

In cell A2, there is char 2328050010001023841.
The format for those value must be string instead of number based on Excel's
specifications,
which has 15 digit precision.

If I get a list of string under A column, does anyone have any suggestions
on how to sort it in ascending order based on macro coding?
Thank everyone very much for any suggestions
Eric

Hi

Range("A2:A100").Sort Key1:=Range("A2"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

BTW: To enter numbers as text, enter ' (single quotation sign) before
the number.

Regards,
Per
 
H

Howard Kaikow

Eric said:
In cell A2, there is char 2328050010001023841.
The format for those value must be string instead of number based on Excel's
specifications,
which has 15 digit precision.

If I get a list of string under A column, does anyone have any suggestions
on how to sort it in ascending order based on macro coding?
Thank everyone very much for any suggestions
Eric


See http://www.standards.com/index.html?Sorting
 
E

Eric

Thank everyone very much for suggestions
Could you please give me more information on where to put those codeing?
I would like to keep column A untouch, and show the sorted results on column
B.
Do you have any suggestions?
Thank everyone very much for any suggestions
Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top