Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort Macro (2 levels)
The code below sorts column "A" but if I wanted to add a level to the sort
that would sort column "B". How would I do that? Range("data1").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlNo Thanks Carlos |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort Macro (2 levels)
try something like this
With Range("data1") .Sort Key1:=.Range("A1"), Order1:=xlAscending, Key2:=.Range("B1") _ , Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _ :=xlSortNormal End With -- Gary "cgsteel" wrote in message ... The code below sorts column "A" but if I wanted to add a level to the sort that would sort column "B". How would I do that? Range("data1").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlNo Thanks Carlos |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort Macro (2 levels)
2 things:
watch the word-wrap and this will work in xl2003 and later. -- Gary "cgsteel" wrote in message ... The code below sorts column "A" but if I wanted to add a level to the sort that would sort column "B". How would I do that? Range("data1").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlNo Thanks Carlos |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro - security levels | Excel Discussion (Misc queries) | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
How can I data sort to more than 3 levels | New Users to Excel | |||
Do a data sort to more levels at once | Excel Discussion (Misc queries) | |||
Set Security levels via macro | Excel Programming |