LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Sorting two columns of data

If your column is populated with numbers, then it will sort 1,2,10,20.
If your column is populated with numeric text, then it will sort
1,10,2,20.

If you have numeric text and you want to convert to numbers, then select
the column, then Data Text to Columns. Then click Finish. Now sort.

If you have numbers that you want to convert to numeric text, then
select the column, Data Text to Columns, Next, Next. You should be at
step 3 of the Wizard (this is Excel97) where you can specify your data
type -- choose Text and click Finish. Now sort.

If you've got a different version of Excel, I don't know what the exact
steps might be, but you should be able to do something similar.

--
Dianne


In ,
Nick Holway <nickATholwayDOTeclipseDOTcoDOTuk (Replace capitals with
symbols) typed:
Hi,

I'm trying to write a script in VBA to sort two columns of data. The
data source cannot be changed as it is the order of genes we have
printed on an array. I want to have the gene names in order then a
dilution factor like this:

gene 1 1
gene1 2
gene1 4
gene2 1
gene2 2
etc

In the left hand column I have names such as gene1 and then a
dilution eg 32x which looks like "gene1 32x". I've pulled out the
number out of the name and put it in column two and then deleted it
in column 1. I then tried to record a sort using the macro recorder,
sorted column A, then by B. The problem is that when there are two
digits ie 16 or 32 they don't sort in the right order compared to the
single digit numbers.

Has any one any idea how to sort this out (sorry about the pun :-)).

If it's any help I'm using Excel 2002 on Windows XP Pro.

TIA

Nick Holway



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting data in columns alan.holmes Excel Worksheet Functions 2 August 24th 08 07:40 PM
Sorting data by columns ub Excel Worksheet Functions 4 April 2nd 08 07:51 PM
Sorting Data into columns without replacing the columns with data Sandaime New Users to Excel 2 October 18th 07 01:35 PM
sorting data in columns Spiderman Excel Discussion (Misc queries) 2 October 6th 05 09:45 PM
Sorting two columns of data Max Excel Worksheet Functions 6 June 13th 05 01:30 AM


All times are GMT +1. The time now is 01:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"