Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi all, Why won't this sort the range below row 3, or in other words, the first 3 rows have data, so the sort will start in row 4 and go down. Columns("A:J").Select Selection.Sort _ Key1:=Range("A4"), Order1:=xlAscending, _ Key2:=Range("C4"), Order2:=xlAscending, _ Key3:=Range("B4"), Order3:=xlAscending, _ Header:=xlYes, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom I thought setting the range would start at row 4 but guess not. -- Desert Piranha ------------------------------------------------------------------------ Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934 View this thread: http://www.excelforum.com/showthread...hreadid=504718 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Desert Piranha,
Try : '============= Public Sub Tester() Dim rng As Range Set rng = Intersect(Columns("A:J"), ActiveSheet.UsedRange) Set rng = rng.Offset(3). _ Resize(rng.Rows.Count - 3, rng.Columns.Count) rng.Sort _ Key1:=Range("A4"), Order1:=xlAscending, _ Key2:=Range("C4"), Order2:=xlAscending, _ Key3:=Range("B4"), Order3:=xlAscending, _ Header:=xlYes, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom End Sub '<<============= --- Regards, Norman "Desert Piranha" <Desert.Piranha.2262jy_1138152603.1292@excelforu m-nospam.com wrote in message news:Desert.Piranha.2262jy_1138152603.1292@excelfo rum-nospam.com... Hi all, Why won't this sort the range below row 3, or in other words, the first 3 rows have data, so the sort will start in row 4 and go down. Columns("A:J").Select Selection.Sort _ Key1:=Range("A4"), Order1:=xlAscending, _ Key2:=Range("C4"), Order2:=xlAscending, _ Key3:=Range("B4"), Order3:=xlAscending, _ Header:=xlYes, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom I thought setting the range would start at row 4 but guess not. -- Desert Piranha ------------------------------------------------------------------------ Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934 View this thread: http://www.excelforum.com/showthread...hreadid=504718 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Norman Jones Wrote: Hi Desert Piranha, Try : '============= Public Sub Tester() Dim rng As Range Set rng = Intersect(Columns("A:J"), ActiveSheet.UsedRange) Set rng = rng.Offset(3). _ Resize(rng.Rows.Count - 3, rng.Columns.Count) rng.Sort _ Key1:=Range("A4"), Order1:=xlAscending, _ Key2:=Range("C4"), Order2:=xlAscending, _ Key3:=Range("B4"), Order3:=xlAscending, _ Header:=xlYes, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom End Sub '<<============= --- Regards, Norman "Desert Piranha" <Desert.Piranha.2262jy_1138152603.1292@excelforu m-nospam.com wrote in message news:Desert.Piranha.2262jy_1138152603.1292@excelfo rum-nospam.com... Hi all, Why won't this sort the range below row 3, or in other words, the first 3 rows have data, so the sort will start in row 4 and go down. Columns("A:J").Select Selection.Sort _ Key1:=Range("A4"), Order1:=xlAscending, _ Key2:=Range("C4"), Order2:=xlAscending, _ Key3:=Range("B4"), Order3:=xlAscending, _ Header:=xlYes, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom I thought setting the range would start at row 4 but guess not. -- Desert Piranha ------------------------------------------------------------------------ Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934 View this thread: http://www.excelforum.com/showthread...hreadid=504718 Hi Norman, Thx much, works fine, now to try to finish this project before daylight. Thx again Norman -- Desert Piranha ------------------------------------------------------------------------ Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934 View this thread: http://www.excelforum.com/showthread...hreadid=504718 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |