Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I write lots of simple macros (see below) to sort my data various
ways, but because the sort keys are associated to specific Columns, each time I move columns around, the sort breaks. Is there some way to write the sort such that it will still work after I move around some columns? It is a pain to have to back and manyally update all the cell names. Maybe using the Header Row names? Seems like Excel is so very good at updating dell references when you insert, delete, and move things around that there is probably a better way to do this. Sub SortByStateDisctrictSchool() Cells.Select Selection.Sort Key1:=Range("G2"), Order1:=xlAscending, Key2:=Range("H2") _ , Order2:=xlAscending, Key3:=Range("A2"), Order3:=xlAscending, _ Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom End Sub Using Excel 2000 Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
unable to move page breaks | Excel Worksheet Functions | |||
Move page breaks programmatically... | Excel Programming | |||
Move page breaks | Excel Discussion (Misc queries) | |||
why can't I move page breaks? | Excel Discussion (Misc queries) | |||
move page breaks | Excel Worksheet Functions |