View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Bridges[_2_] Bob Bridges[_2_] is offline
external usenet poster
 
Posts: 257
Default Very Unusual Sort Rows Needed

There are undoubtedly other ways to do this, but what occurs to me (after
some thought, I confess) is to create a helper column -- in Z, let's say --
with this formula:

=IF(M2="",N2&"N",M2&"M")

That results in col z having the following values:200M, 300M, 100M, 200N,
100N, 300N, 200N etc... Sort on Z and your rows should be in the order you
want. Look, ma, no macro!

---"RONZANDER" wrote:
I have a worksheet that I need to sort the rows based on two columns.
Now before everyone tries to tell me how to sort using Excel's sort
function, I will state that it will not do what I need and this is why
and what I need to discover a macro to do...

Example:
A B
----- -----
200
300
100
200
100
300
200
100
300
etc, etc, etc

After "Sort" Macro:
A B
----- -----
100
100
100
200
200
200
300
300
300

And now for the fun part? The sort on data is NOT in column A & B, but
rather in columns M & N and must stay that way.

Any ideas?