Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
.Sort.SortFields
Problem... I am downoading mi data to excel, after that I have this macro
that sorts the information by coulum A, but it is only sorting .SetRange Range("A11:N95"), this is ther range when i created the macro, how do I sort the selected range insted of the Raneg Set by the recorded macro. Range("A11").Select Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select ActiveWorkbook.Worksheets("Recovered_Sheet1").Sort .SortFields.Clear ActiveWorkbook.Worksheets("Recovered_Sheet1").Sort .SortFields.Add Key:=Range( _ "A11"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _ xlSortNormal With ActiveWorkbook.Worksheets("Recovered_Sheet1").Sort .SetRange Range("A11:N95") .Header = xlNo .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
.Sort.SortFields
with selection
.Cells.Sort key1:=.Columns(1), order1:=xlAscending, _ Header:=xlno, MatchCase:=False, Orientation:=xlTopToBottom End with MESTRELLA29 wrote: Problem... I am downoading mi data to excel, after that I have this macro that sorts the information by coulum A, but it is only sorting .SetRange Range("A11:N95"), this is ther range when i created the macro, how do I sort the selected range insted of the Raneg Set by the recorded macro. Range("A11").Select Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select ActiveWorkbook.Worksheets("Recovered_Sheet1").Sort .SortFields.Clear ActiveWorkbook.Worksheets("Recovered_Sheet1").Sort .SortFields.Add Key:=Range( _ "A11"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _ xlSortNormal With ActiveWorkbook.Worksheets("Recovered_Sheet1").Sort .SetRange Range("A11:N95") .Header = xlNo .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
.Sort.SortFields
Excelente!!!!!
Gracias!!!! HAPPY NEW YEAR ! ! ! "Dave Peterson" wrote: with selection .Cells.Sort key1:=.Columns(1), order1:=xlAscending, _ Header:=xlno, MatchCase:=False, Orientation:=xlTopToBottom End with MESTRELLA29 wrote: Problem... I am downoading mi data to excel, after that I have this macro that sorts the information by coulum A, but it is only sorting .SetRange Range("A11:N95"), this is ther range when i created the macro, how do I sort the selected range insted of the Raneg Set by the recorded macro. Range("A11").Select Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select ActiveWorkbook.Worksheets("Recovered_Sheet1").Sort .SortFields.Clear ActiveWorkbook.Worksheets("Recovered_Sheet1").Sort .SortFields.Add Key:=Range( _ "A11"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _ xlSortNormal With ActiveWorkbook.Worksheets("Recovered_Sheet1").Sort .SetRange Range("A11:N95") .Header = xlNo .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Updating workbook with an alpha sort sheet and a numeric sort shee | Excel Discussion (Misc queries) | |||
sort function for dates does not sort properly in Office 2007 Exc. | Excel Worksheet Functions | |||
Pls. reply Sort Data and copy to next coulmn when sort order chang | Excel Programming | |||
Excel sort by Fill Color by custom list sort | Excel Discussion (Misc queries) | |||
sort (on part of) string - originally posted under Tricky Sort | Excel Programming |