sorting problems

Tonto111

Board Regular
Joined
Jun 17, 2002
Messages
83
I have a macro that shows contracts of a certain type (supply, construction, etc.) It then sorts the contracts in order, with the highest number (most recent contract) on top.

However, we recently changed the prefix for our contracts from 670X to 528X, but kept the sequential numbers at the end. For example, an old contract would be 670X-100, while the next contract under the new system would be 528X-101. When you try to sort by descending order, it wants to put these new contracts at the bottom because 528 is less than 670. Any ways to get around this? THANKS
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

plettieri

Well-known Member
Joined
Sep 4, 2002
Messages
1,556
Platform
  1. MacOS
You might trying to insert a column and identifying the contracts A for the series that starts with 6.... then B for the series that begin with a 5....

Then do a double sort with this field first then the contract number field second....

This may not be the cleanest way but it should get the job done.


good luck

pll
This message was edited by plettieri on 2002-10-15 14:32
This message was edited by plettieri on 2002-10-15 14:33
 

Mark W.

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,654
Sort on a column containing the formula...

=RIGHT(A1,LEN(A1)-FIND("-",A1))

...where column A contains your original value.
 

Tonto111

Board Regular
Joined
Jun 17, 2002
Messages
83
I ended up just putting a space in front of the 670, now when I sort in descending order the 528 contracts are on top. Yay :LOL:
This message was edited by Tonto111 on 2002-10-16 11:08
 

Forum statistics

Threads
1,144,278
Messages
5,723,465
Members
422,498
Latest member
KAT112014

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top