View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default Sorting number as text

With cells formatted as General, you can use the FIXED function to convert
the number only cells to text:
=FIXED(A1,0,TRUE) (no decimal and no commas). Then Copy/Paste Special/
Values, this result over the original cells. Leave the cells that have text
in them alone.

Mike F
"boris_lui" wrote
in message ...

I have a worksheet containing the PO order information. Column A is
storing the PO number which is usually a number but sometimes includes
characters, like

123
123R
246
156

I want the sorting result accroding to the ASCII order, like
123
123R
156
246

But the result is like
123
156
246
123R

I just learnt that I should format the cells with Number As Text before
filling in the value. As there are a lot of data already entered, is
there any workaround to overcome the situation?

I had tried to create another dummy column and format it with Number as
Text. Then copy the PO Number Column to that dummy column with Paste
Specail - Value. The sorting wrong is still wrong.

I had also tried to add the character ` to the beginning of each cell
value. The sorting is then correct, but it makes my application
extremely slow.
(My Application is just "FIND" a particular PO, recall the row data
into a user form, modify the data and save it back to that row).


Thanks


--
boris_lui
------------------------------------------------------------------------
boris_lui's Profile:
http://www.excelforum.com/member.php...o&userid=28489
View this thread: http://www.excelforum.com/showthread...hreadid=481714