View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
m3s3lf[_12_] m3s3lf[_12_] is offline
external usenet poster
 
Posts: 1
Default 1 click sorting *almost there*


Well, I had just got it working when I saw your post. Thanks to
everyone for the help. This is how I ended up making it work:

I changed this:

Code:
--------------------
Sub ArchiveSortBySalePrice()
Range("ClosedSales").Sort Key1:=Range("D2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub
--------------------


To this:

Code:
--------------------

Sub ArchiveSortBySalePrice()
Dim SortOrder As String
EndRow = Range("D65536").End(xlUp)
If Range("D3") = EndRow Then
SortOrder = xlAscending
ElseIf Range("D3") < EndRow Then
SortOrder = xlDescending
End If
Range("ClosedSales").Sort Key1:=Range("D3"), Order1:=SortOrder, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub

--------------------


Thanks again!


--
m3s3lf
------------------------------------------------------------------------
m3s3lf's Profile: http://www.excelforum.com/member.php...o&userid=34874
View this thread: http://www.excelforum.com/showthread...hreadid=564975