View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Matthew Pfluger Matthew Pfluger is offline
external usenet poster
 
Posts: 130
Default Sorting on more than one column

Try this:

Range("A1:C7").Select
Selection.Sort Key1:=Range("C2"), Order1:=xlAscending, Key2:=Range("A2")
, Order2:=xlDescending, Header:=xlYes

You may have to change "Range("A1:C7")" to fit your data range.

HTH,
Matthew Pfluger

"Jock" wrote:

How can I sort numbers from 1-7 in column 'C' ascending and then sort the
dates in column 'A' in descending order for each group of numbers in 'C' with
one piece of code?

A C
15/08 2
14/08 3
16/08 2
17/08 3
16/08 3
15/08 1

Hope that makes sense!!

--
Traa Dy Liooar

Jock