Selection.Sort not working?

  • Thread starter Thread starter Avery
  • Start date Start date
A

Avery

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
 
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)
 
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)




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top