View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Saxman Saxman is offline
external usenet poster
 
Posts: 111
Default Inconsistent Sorting

Dave Peterson wrote:
I declared a variable named keycol--I meant to use that in the sort routine.
But you can specify up to 3 keys in your sort. I used keycol1, keycol2, and
keycol3. I wasn't sure when/what you sorted.

But this line:

myRngToSort.Sort _
key1:=.Columns(KeyCol1), order1:=xlAscending, _
key2:=.Columns(KeyCol2), order1:=xlAscending, _
key3:=.Columns(KeyCol3), order1:=xlAscending, _
header:=xlNo


This sorts column 'J' ascending. Ideally I would like it descending. I
assume I can alter the code to descending in the above?

How do I need to modify the code to do a sort on column 'K'?

Once 'J' has been sorted ascending would it be possible to rank them
1,2,3, etc. in column 'N'.

I would need to do the same for column 'O' and rank them in column 'P'.

As I said before the data is imported with column 'L' already sorted.
These would need ranking in column 'P'.

Maybe I could send a sample sheet to you?

Thanks for you time and tenacity.