View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nick Holway Nick Holway is offline
external usenet poster
 
Posts: 2
Default Sorting two columns of data


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