View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Paul D. Simon Paul D. Simon is offline
external usenet poster
 
Posts: 46
Default How do I sort by the first digit of a number?

Hi Laura,

This macro will change existing numbers to text:

Sub TextToNumbers()
Selection.TextToColumns Destination:=ActiveCell,
DataType:=xlFixedWidth, FieldInfo:=Array(0, 2)
End Sub

Highlight the cells containing numbers that you want to change to text
and run the code above. Once that's done, you can sort them, and they
will then indeed be in the order you requested.