Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamic Sort
How do I change the following code to sort by a parameter SortCol1 and SortCol2, which
contains the column identifiers by which I want to sort? For example, SortCol1 = 3 (or "C" if if would be better), SortCol2 = 1 (or "A" if if would be better)... Cells.Select Application.CutCopyMode = False Selection.Sort Key1:=Range("C2"), Order1:=xlAscending, Key2:=Range("A2") _ , Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _ :=xlSortNormal Thanks, Bernie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Merge & Sort Dynamic Lists w/ Data Validation | Excel Discussion (Misc queries) | |||
Merge & Sort Dynamic Lists w/ Data Validation | Excel Worksheet Functions | |||
How to read offset cells from dynamic sort array formula? | Excel Discussion (Misc queries) | |||
Dynamic column chart - auto sort on data range | Charts and Charting in Excel | |||
dynamic sort macro across 3 linked sheets | Excel Discussion (Misc queries) |