View Single Post
  #4   Report Post  
Paul D. Simon
 
Posts: n/a
Default

This seemed to work on the small sample you provided, but I don't know
how it will work on the entire set. Give it a try and let me know.

Insert a "helper" column to the right of your Contract Number column.
Let's say that your Contract Number column is column A, then insert a
new column B.

Let's also say that A1 contains the heading "Contract Number", then
enter something like "SortCode" as a heading in B1.

Using the above examples, then your first contact number will be in A2.
Then enter this formula in B2. =IF(ISNUMBER(VALUE(LEFT(A2,1))),2,1)

Now copy the formula down all the cells til you reach the bottom of
your contract numbers. This obviously results in a 2 next to each
contract number that begins with a number and a 1 next to each contract
number that begins with a letter.

The key now is sorting the data to get the result you want. Both the
order of sort and proper use of ascending and descending as noted below
is crucial. Here's how:

DataSort
Sort by SortCode Ascending
Then by Contract Number Descending

Once sorted, you can delete the "helper" column B if you like. If
you're proficient at writing VBA code, you can also try your hand at
automating this.

As I said, this worked on the small sample you provided. Let me know
whether or not it gives you the results you want on the entire set.