View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
srroduin srroduin is offline
external usenet poster
 
Posts: 34
Default 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