Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting Question Curtis S. Excel Worksheet Functions 1 October 11th 06 05:39 PM
sorting question kolonelvonklink Excel Discussion (Misc queries) 2 August 22nd 06 12:20 PM
Row sorting question jezzica85 Excel Discussion (Misc queries) 3 May 4th 06 11:13 PM
Sorting question blueglass74 Excel Discussion (Misc queries) 2 February 23rd 06 12:34 AM
Sorting Question Tim Excel Discussion (Misc queries) 1 April 7th 05 04:57 PM


All times are GMT +1. The time now is 07:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"