View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
azSuch azSuch is offline
external usenet poster
 
Posts: 3
Default Save Excel rows that contain specific text

Hi,
I got this code at http://www.mvps.org/dmcritchie/excel/delempty.htm
It deletes the rows that contain the text ANN. What Im asking for is
the opposite. Can it be modified to save the rows that contain the
text ANN???????

Sub Find_ANN()
Dim rng As Range
Dim what As String
what = "ANN"
Do
Set rng = ActiveSheet.UsedRange.Find(what)
If rng Is Nothing Then
Exit Do
Else
Rows(rng.Row).Delete
End If
Loop
End Sub