Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I recorded the macro below and need to modify it for use in varing number of records.
================================================== =========== Range("A1:X1").Select Range(Selection, Selection.End(xlDown)).Select ActiveWorkbook.Worksheets("sectxW").SORT.SortField s.Clear ActiveWorkbook.Worksheets("sectxW").SORT.SortField s.Add Key:=Range("A2:A7746" _ ), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal ActiveWorkbook.Worksheets("sectxW").SORT.SortField s.Add Key:=Range("F2:F7746" _ ), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal ActiveWorkbook.Worksheets("sectxW").SORT.SortField s.Add Key:=Range("I2:I7746" _ ), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal With ActiveWorkbook.Worksheets("sectxW").SORT .SetRange Range("A1:X7746") .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With ================================================== ======================== I guess the following need to be modified to accept variable number of records :Range("A2:A7746"), Range("F2:F7746"),Range("I2:I7746"), Range("A1:X7746") Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I sort variables into sets of three? | Excel Discussion (Misc queries) | |||
Sort with two variables | New Users to Excel | |||
Sort by Variables | Excel Programming | |||
Linking Cells and applying a sort | Excel Worksheet Functions | |||
sort for variables | Excel Programming |