View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Macro to sort selected area

If you're using xl2003 (or higher), you can apply data|filter|autofilter.
There's an option under each arrow that allows you to sort the filtered range by
that field.

But those empty rows scare me. Excel may not see them as part of your range to
be sorted.

If you're using xl2002 or below (or any version of excel, really), you can use a
technique at Debra Dalgleish's site:

http://contextures.com/xlSort02.html



wrote:

Hello, would someone be able to set me in the right direction to
create a Macro to sort a seleted range, then sort when button is
pressed.
Range will always be column A to M, sort Desc on column I, starting at
A7 (rows 1 to 6 are header) the problem being that the number of rows
varies from 2 to 100 or so. Need the Macro to sort the selected area
thanks.
I can manage to do a macro for a set number of rows but having trouble
when the number of rows varies
regards
Ditchy
Ballarat, Australia


--

Dave Peterson