Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
help: sorting rows by lesser value of two columns
I'd like a VB script method of sorting that uses two columns (both
contain dates/times). I want to sort the entire row in ascending order by the lesser value of the two columns. Example: column A Column B Row 1: 1 2 <--lesser value is 1 Row 2: 2 2 <--Lesser value is 2 Row 3: 4 4 <--Lesser value is 4 Row 4: 5 3 <--Lesser value is 3 BECOMES: column A Column B Row 1: 1 2 Row 2: 2 2 Row 3: 5 3 Row 4: 4 4 I could do it using a third column, but would prefer something more elegant using a temproray array. Any help would be appreciated. My problem is this: I can create a "sort-order array", but I don't know how to shuffle the rows according to the sequence of the array. Thanks in advance, Todd |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
help: sorting rows by lesser value of two columns
sorry that wrapped funny. Perhaps this will be clearer:
Example: * * * * * column A * * Column B Row 1: * 1 2 ** * *<--lesser value is 1 Row 2: * 2 2* * * *<--Lesser value is 2 Row 3: * 4 4 * * *<--Lesser value is 4 Row 4: * 5 3 * * *<--Lesser value is 3 BECOMES: * * * * * column A * * Column B Row 1: * 1 * * * * * * * * 2 Row 2: * 2 * * * * * * * * 2 Row 3: * 5 * * * * * * * * 3 Row 4: * 4 * * * * * * * * 4 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
sorting and getting calculations in other columns use new rows | Excel Discussion (Misc queries) | |||
sorting out columns but only for some rows | Excel Discussion (Misc queries) | |||
How to keep rows together when sorting columns? | Excel Worksheet Functions | |||
Sorting rows AND columns | Excel Worksheet Functions | |||
Sorting rows and columns using VBA | Excel Programming |