Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting Spreadsheet Selection - Recurring Sort MarkCA Excel Worksheet Functions 0 June 14th 07 08:41 PM
How can I sort a selection of cells into random order? IanS Excel Discussion (Misc queries) 2 June 14th 07 12:31 PM
Macro - Data Sort -Variable Selection Frantic Excel-er Excel Discussion (Misc queries) 3 June 6th 05 10:33 PM
Selection.Sort not working? Avery[_2_] Excel Programming 2 May 5th 04 07:03 PM
Need a macro for selection and sort gmangad[_5_] Excel Programming 1 January 11th 04 11:44 AM


All times are GMT +1. The time now is 08:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"