Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Manually editing Sort function in VBA
I Have beem attempting to manually do my own sorting in VBA, but to no
avail. So I record a macro that sorts, and that works fine. BUT, if I want to edit it, it no longer works, also, If I manually type the EXACT same arguement , it doesnt work. The only thing that works so far in VBA, is just running the macro and cutting it and pasting it to my macro. Here is what excel records Rows("1:11").Select Selection.Sort Key1:=Range("A2"), Order1:=xlDescending, Key2:=Range("B2") _ , Order2:=xlDescending, Header:=xlYes, OrderCustom:=1, MatchCase:=False _ , Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:= _ xlSortNormal |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Manually editing Sort function in VBA
I have had the situation where i needed to sometimes do
multiple sorts. what i did was have a sort macro for each way i needed to sort. that way i didn't need to edit the sort macro. in one file i had the sort macros assigned to 2 buttons on the sheets. the user could sort one way by click one button then sort the other way by click the other button. -----Original Message----- I Have beem attempting to manually do my own sorting in VBA, but to no avail. So I record a macro that sorts, and that works fine. BUT, if I want to edit it, it no longer works, also, If I manually type the EXACT same arguement , it doesnt work. The only thing that works so far in VBA, is just running the macro and cutting it and pasting it to my macro. Here is what excel records Rows("1:11").Select Selection.Sort Key1:=Range("A2"), Order1:=xlDescending, Key2:=Range("B2") _ , Order2:=xlDescending, Header:=xlYes, OrderCustom:=1, MatchCase:=False _ , Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:= _ xlSortNormal . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I manually sort the legend key? | Charts and Charting in Excel | |||
sort function for dates does not sort properly in Office 2007 Exc. | Excel Worksheet Functions | |||
Need Help Editing this Function... | Excel Worksheet Functions | |||
Can you sort worksheets other than manually? | Excel Discussion (Misc queries) | |||
Excel Sort function should not sort the cell formatting! | Excel Worksheet Functions |