Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting Question
I have a the following code that sorts according to two columns. Column B is
either a variable called SASIncrease or one called SASDecrease. Column N is a date. I have it putting column B in alphabetical order and secondly sorting the dates. Is there a way to put all of the rows with SASIncrease in column B first followed by all the ones with SASDecrease instead of putting it in alphabetical order? Other loops that I have keep messing up if the SASDecrease is before the SASIncrease rows. Here's the code: Range("A10:U" & Range("A65536").End(xlUp).Row).Select 'This will sort using SAS number (B) and Start date (N) Selection.Sort Key1:=Range("B10"), key2:=Range("N10"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting Question
Never mind. I figured it out. :)
"srroduin" wrote: I have a the following code that sorts according to two columns. Column B is either a variable called SASIncrease or one called SASDecrease. Column N is a date. I have it putting column B in alphabetical order and secondly sorting the dates. Is there a way to put all of the rows with SASIncrease in column B first followed by all the ones with SASDecrease instead of putting it in alphabetical order? Other loops that I have keep messing up if the SASDecrease is before the SASIncrease rows. Here's the code: Range("A10:U" & Range("A65536").End(xlUp).Row).Select 'This will sort using SAS number (B) and Start date (N) Selection.Sort Key1:=Range("B10"), key2:=Range("N10"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sorting Question | Excel Worksheet Functions | |||
sorting question | Excel Discussion (Misc queries) | |||
Row sorting question | Excel Discussion (Misc queries) | |||
Sorting question | Excel Discussion (Misc queries) | |||
Sorting Question | Excel Discussion (Misc queries) |