Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
sort method frustration
The is method the first sort works fine.
srange.Sort _ Key1:=Cells(1, intSortColumn), Order1:=xlAscending, Header:=xlYes When I want to sort directly after by second column. I receive runtime error "1004" srange.Sort _ Key1:=Cells(1, intSortColumn2), Order1:=xlAscending, Header:=xlYes intsortcolumn2 does hold a value srange is a valid object. row 1 is the header. Ideally I would like sort by both keys at the same time. I used the macro record Selection.Sort Key1:=Range(Cells(1, intSortColumn), Cells(1, intSortColumn)), Order1:=xlAscending, _ Key2:=Range(Cells(1, intSortColumn2), Cells(1, intSortColumn2)) _ , Order2:=xlAscending, Header:=xlYes, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _ :=xlSortNormal Same error results. Why is sort such a pain in the you know where? Any ideas? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need really fast method to sort data for my part numbering spread | Excel Discussion (Misc queries) | |||
Please post this thread a correct full method, method about | New Users to Excel | |||
Please post this thread a complete correct method, method about te | New Users to Excel | |||
VBA Sort method w/more than 3 Keys | Excel Discussion (Misc queries) | |||
Sort method of range | Excel Programming |