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 not working?

I'm trying to execute a simple sort on a selection in
Excel. The help file, as well as most of the online
guides I've read have suggested using:

Selection.Sort

However, even if I simplify my request to the following
lines, I still get the "application or user defined error"

Worksheets(1).Range("A27:H38").Select
Selection.sort


Anybody know what's going on here?

Thanks


Avery
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Selection.Sort not working?

You have to specify a sort key at the minimum.

Worksheets(1).Range("A27:H38").sort Key1:=Range("A27")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Avery" wrote in message
...
I'm trying to execute a simple sort on a selection in
Excel. The help file, as well as most of the online
guides I've read have suggested using:

Selection.Sort

However, even if I simplify my request to the following
lines, I still get the "application or user defined error"

Worksheets(1).Range("A27:H38").Select
Selection.sort


Anybody know what's going on here?

Thanks


Avery



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Selection.Sort not working?

Ah, brilliant. Thank you.


Avery



-----Original Message-----
You have to specify a sort key at the minimum.

Worksheets(1).Range("A27:H38").sort Key1:=Range("A27")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Avery" wrote in message
...
I'm trying to execute a simple sort on a selection in
Excel. The help file, as well as most of the online
guides I've read have suggested using:

Selection.Sort

However, even if I simplify my request to the following
lines, I still get the "application or user defined

error"

Worksheets(1).Range("A27:H38").Select
Selection.sort


Anybody know what's going on here?

Thanks


Avery



.

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
Ctrl-Space Column Selection No Longer Working MPW Excel Discussion (Misc queries) 11 November 22nd 06 06:07 PM
Range selection not working kanan Excel Programming 3 April 22nd 04 05:19 PM
Selection.count isnt working No Name Excel Programming 2 February 8th 04 03:23 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 10:18 PM.

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

About Us

"It's about Microsoft Excel"