Sortin Numbers as Text: How?

  • Thread starter Thread starter William C. Smith
  • Start date Start date
W

William C. Smith

No mater what I do Excel in its infinite wisdom sorts numbers as numbers. I
want it to sort the numbers as text. I have not tried prefixing the entered
numbers with an "'". The data comes from another application as text. In my
version of Excel (Excell 2000 (9.0.3821 SR1), the options button ot the
Data/Sort menue will not accept new custom sort orders. Is there a way to
sort text numbers as text?
 
I think the only way is to add the "'" character at the front of the numeric values to force Excel to think of them as text

To quickly process all cells and add the prefix character, you may use the following macro. First select the range of cells which contains the numbers and then run the macro

Sub convert_to_text(
Dim cell As Objec
For Each cell In Selection.Cell
If IsNumeric(cell) Then cell.Value = "'" & cell.Valu
Nex
End Su


----- William C. Smith wrote: ----

No mater what I do Excel in its infinite wisdom sorts numbers as numbers. I
want it to sort the numbers as text. I have not tried prefixing the entered
numbers with an "'". The data comes from another application as text. In my
version of Excel (Excell 2000 (9.0.3821 SR1), the options button ot the
Data/Sort menue will not accept new custom sort orders. Is there a way to
sort text numbers as text
 
To sort numbers as text (as below) the range the numbers are in must be
formatted as text. If you have already entered the data then you must
either re-enter it or,

Select menu item:
Data / Text to Columns - then select next / next and then select text in
the last screen then /Finish.
I'm not sure if Excel 2000 has this feature I'm running Excel 2002.

1
10
11
12
13
14
15
16
17
18
19
2
20
21
22
 
Thank you Rocky. Windows 2000 does have the Text to Columns feature and it
works!
 
Back
Top