Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks. I hadn't gotten to the combo yet of doing the minor fields first.
What I actually ended up doing is that I was lucky in that my data in two of the columns allowed me to concatenate into another cell so I ended up sorting on 3 columns, but '4columns worth' of data. "Nigel" wrote: Hi You can do as many sorts as you like - but only 3 at anyone time. Sorts in Excel are persistent, so if you start with the lowest order sort key and end with the highest order you will get the result you require. -- Cheers Nigel "Neal Zimm" wrote in message ... Not knowing any better, I took the recorded code for a 3 column sort and tried to turn it into a 4 column sort. Got run time 1004 object error. Code is below. Is it possible to do what I'm trying this way? I'd rather not have to select different ranges of cells and do a 3 column sort, but I may have to. So, have I made an error in the code, or is it just not possible? Thanks. Sub zsortbcda() Application.ScreenUpdating = False Columns("A:D").Select Selection.Sort Key1:=Range("B1"), Order1:=xlAscending, _ Key2:=Range("C1"), Order2:=xlAscending, _ Key3:=Range("D1"), Order3:=xlAscending, _ Key4:=Range("A1"), Order4:=xlAscending, _ Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, _ DataOption3:=xlSortNormal, DataOption4:=xlSortNormal Range("A1").Select Application.ScreenUpdating = True End Sub -- Neal Z |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to sort without including column headings in sort | Excel Discussion (Misc queries) | |||
Auto-Sort Won't Sort All Column Cells | Excel Discussion (Misc queries) | |||
data, sort option is grayed. how to sort on a column? | Excel Discussion (Misc queries) | |||
How can I sort one column and have the entire row sort. (binding) | Excel Worksheet Functions | |||
April Fools | Excel Programming |