View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
A[_3_] A[_3_] is offline
external usenet poster
 
Posts: 6
Default code for sort until cell equals...

Look like I figured it out.. pretty easy otherwise I wouldn't have
been able to get it

Thanks.

Sub Macro1()
Dim r As Range
Dim Rng As Range
Set r = Range("AA22")
Set Rng = Range("M:N")
Do
Rng.Sort _
Key1:=Range("N:N"), _
Order1:=xlAscending, _
Header:=xlYes, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom
Loop Until r = "MATCH"
End Sub