Selection.Sort error
ActiveSheet.Range("C7").Select ActiveSheet.Range(Selection, Selection.End(xlDown)).Select Selection.Sort Key1:=Range("C7"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom In the above code, the select statements are working correctly, so the range I want is selected, however I get an error on the Selection.Sort statement every time. Any thoughts? -- Krager ------------------------------------------------------------------------ Krager's Profile: http://www.excelforum.com/member.php...o&userid=20936 View this thread: http://www.excelforum.com/showthread...hreadid=401705 |
Selection.Sort error
Ok fixed my own problem, just added an ActiveSheet. in front of the Range in the selection statement and that solved it. Selection.Sort Key1:=ActiveSheet.Range("C7"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom -- Krager ------------------------------------------------------------------------ Krager's Profile: http://www.excelforum.com/member.php...o&userid=20936 View this thread: http://www.excelforum.com/showthread...hreadid=401705 |
Selection.Sort error
I tested yours and it worked but you may want to try this instead
Sub sortmyrange() Range("C7", Range("C7").End(xlDown)). _ Sort Key1:=Range("C7"), Order1:=xlAscending End Sub -- Don Guillett SalesAid Software "Krager" wrote in message ... ActiveSheet.Range("C7").Select ActiveSheet.Range(Selection, Selection.End(xlDown)).Select Selection.Sort Key1:=Range("C7"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom In the above code, the select statements are working correctly, so the range I want is selected, however I get an error on the Selection.Sort statement every time. Any thoughts? -- Krager ------------------------------------------------------------------------ Krager's Profile: http://www.excelforum.com/member.php...o&userid=20936 View this thread: http://www.excelforum.com/showthread...hreadid=401705 |
Selection.Sort error
What's the text of the error?
Tim "Krager" wrote in message ... ActiveSheet.Range("C7").Select ActiveSheet.Range(Selection, Selection.End(xlDown)).Select Selection.Sort Key1:=Range("C7"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom In the above code, the select statements are working correctly, so the range I want is selected, however I get an error on the Selection.Sort statement every time. Any thoughts? -- Krager ------------------------------------------------------------------------ Krager's Profile: http://www.excelforum.com/member.php...o&userid=20936 View this thread: http://www.excelforum.com/showthread...hreadid=401705 |
All times are GMT +1. The time now is 10:52 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com