View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default how to sort many rows independently?


Sub SortSpecies()
Dim rng as Range, cell as Range
set rng = Range(Range("F2"),Range("F2").end(xldown))
for each cell in rng
cell.Resize(1,155).Sort Key1:=cell, _
Order1:=xlDescending, _
Header:=xlNo, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlLeftToRight, _
DataOption1:=xlSortNormal
Next
End Sub

--
Regards,
Tom Ogilvy



"guillemot" wrote
in message ...

Tom,

Thanks for replying. I have very limited programming experience (in any
language) and VB is the language that I'm least familiar with. Can you
help clarify what you've written for a beginner?

I recorded the macro as you instructed. Then I opend the VB editor.
Here's what the sub looks like:

Sub SortSpecies()
'
' SortSpecies Macro
' Macro recorded 12/23/2005 by T-Dog
'

'
Range("F2:FD2").Select
Selection.Sort Key1:=Range("F2"), Order1:=xlDescending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight,
_
DataOption1:=xlSortNormal
End Sub

How do I get it to do this for all rows that follow? Sorry if this is
really basic (pun intended :D) but I'm a novice!

Cheers,
Jeff


--
guillemot
------------------------------------------------------------------------
guillemot's Profile:

http://www.excelforum.com/member.php...o&userid=29833
View this thread: http://www.excelforum.com/showthread...hreadid=495747