Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
use my code and change
Selection.Sort Key1:=rng, -- Regards, Tom Ogilvy "John" wrote in message ... Frank, This is my code: Range("A1:AE440").Select Selection.Sort Key1:=Range("G2"), Order1:=xlAscending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End Sub Problem happens if I delete a column A - F, which I need to do. The macro will always sort column G, not 'SURNAME' which is in G1. Once again, many thanks John "Frank Kabel" wrote: Hi in your code (which unfortunately you haven't posted) you may for example use - the find method to locate the column - application.match to locate it -- Regards Frank Kabel Frankfurt, Germany "John" schrieb im Newsbeitrag ... I have written a macro which includes a sort. Problem happens when I delete a column and then run the macro. The macro automatically sorts on original column. Can I use the column heading ie SURNAME to sort. This would be the same heading after I delete a column, thus solve my problem. Many thanks John |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sort 2 column in the same time "" as dictionary "" | Excel Worksheet Functions | |||
Missing sort ascending or descending when go into "data" "sort"? | Excel Discussion (Misc queries) | |||
SORT a column of Texts to follow another "EXACT" order | Excel Discussion (Misc queries) | |||
Adding "letters (column headings)" | Excel Discussion (Misc queries) | |||
HOW CAN I SORT A "RANKED" COLUMN WITHOUT LOSING THE FORMULA? | Excel Worksheet Functions |