Thread: search data
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default search data

Hi Daniel

Try out the below

Sub Macro()
Dim varFound As Range, varSearch As String

varSearch = "jac"

With Range("C2:C" & Cells(Rows.Count, "C").End(xlUp).Row)
Set varFound = .Find(varSearch, LookIn:=xlValues, SearchDirection:=xlPrevious)
Do While Not varFound Is Nothing
varFound.EntireRow.Delete
Set varFound = .Find(varSearch, LookIn:=xlValues, SearchDirection:=xlPrevious)
Loop
End With
End Sub

Check out help on Range.Find and adjust the code
LookAt Optional Variant. Can be one of the following XlLookAt constants:
xlWhole or xlPart

--
Jacob


"Daniel M" wrote:

I need to seach a cell range (C2: C last cell) for a specific string. Once
found i need to delete the entire row and continue searching. Can someone
help me with this? Thanks.