Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort Worksheet Records By Column
I need to write code to sort the records contained in a sheet named tracker
by column b (contains a formula that results in a numeric value) in descending order. The row numbers change but will always start with row 3 and end with how many ever rows have data. Also all columns will be included. I want to prevent sorting so that blank rows are sorted to the top. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort Worksheet Records By Column
Does this work for you?
Sub SortMyRng() Dim Rng as range 'Note: you must not have anything in row 2 or any cell immediately around your Rng ' If you have headers, you may need to adjust Set Rng = Sheets("tracker").Range("A3").CurrentRegion Rng.Sort Key1:=Range("B3"), Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom End Sub "Kenny" wrote: I need to write code to sort the records contained in a sheet named tracker by column b (contains a formula that results in a numeric value) in descending order. The row numbers change but will always start with row 3 and end with how many ever rows have data. Also all columns will be included. I want to prevent sorting so that blank rows are sorted to the top. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I sort column changes in different worksheet? | Excel Worksheet Functions | |||
Delete records when certain records have duplicate column data | New Users to Excel | |||
how do I sort a worksheet based on one column? | New Users to Excel | |||
Can I sort a column of #s Rt to left? in a worksheet | Excel Discussion (Misc queries) | |||
Sort by column inside a worksheet | Excel Worksheet Functions |