Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need Help Sorting
Hello,
I am needing help from the excel Masters. I am completely lost and have tried to find my way for the past 3 days. I have given up. Please help me. If I sort from Column A to column H this macro works great Dim sheet1 As Worksheet Dim myrange As Range Dim lrow As Long Set sheet1 = ActiveSheet Set myrange = sheet1.Range("A11") lrow = sheet1.Cells(sheet1.Rows.count, myrange.Column).End(xlUp).Row Set myrange = myrange.Resize(lrow - myrange.Row + 1, 6) myrange.sort key1:=Range("A12"), Order1:=xlAscending, _ Key2:=Range("B12"), Order2:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ SortMethod:=xlSortNormal Now I need to reverse this whole thing and place the contract #'s in column H instead of A and the above macro doesn't work. What do I need to do. Next, I need to sort all of this info by date or by contract #. So, I need a macro to ask me what contract number to be first so that my program will graph it. ie: 123 354 456 Now I want Contract 456 on top. 456 123 354 But now I want Contract 354 on top. 354 123 456 I am sorry to make this so difficult. Hope some on can help me. My email is Eric Dickson |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need Help Sorting
Check one of your earlier posts.
Eric wrote: Hello, I am needing help from the excel Masters. I am completely lost and have tried to find my way for the past 3 days. I have given up. Please help me. If I sort from Column A to column H this macro works great Dim sheet1 As Worksheet Dim myrange As Range Dim lrow As Long Set sheet1 = ActiveSheet Set myrange = sheet1.Range("A11") lrow = sheet1.Cells(sheet1.Rows.count, myrange.Column).End(xlUp).Row Set myrange = myrange.Resize(lrow - myrange.Row + 1, 6) myrange.sort key1:=Range("A12"), Order1:=xlAscending, _ Key2:=Range("B12"), Order2:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ SortMethod:=xlSortNormal Now I need to reverse this whole thing and place the contract #'s in column H instead of A and the above macro doesn't work. What do I need to do. Next, I need to sort all of this info by date or by contract #. So, I need a macro to ask me what contract number to be first so that my program will graph it. ie: 123 354 456 Now I want Contract 456 on top. 456 123 354 But now I want Contract 354 on top. 354 123 456 I am sorry to make this so difficult. Hope some on can help me. My email is Eric Dickson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sorting Values Without Sorting Formulas | Excel Discussion (Misc queries) | |||
Automatic sorting (giving max and min) based on custom sorting lis | Excel Worksheet Functions | |||
Sorting VLookup vs Sorting SumProduct | Excel Discussion (Misc queries) | |||
Sorting: Sorting by the First Character | Excel Discussion (Misc queries) | |||
Sorting ListBox results or transposing ListBox values to other cells for sorting | Excel Programming |