Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
search data
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
search data
search help for find next.
-- Gary Keramidas Excel 2003 "Daniel M" wrote in message ... 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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
search data
hi, Daniel !
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. regarding this "specific" string... - is (upp/low)er case important ? - is it a start-string, middle-string, end-string ? - how many do you expect to be found ? (1, 10, 100, 1000, ...) (just trying to be in "specific" help to you) :D regards, hector. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
search data
This worked perfectly. I was looking at the .find help but was having
problems with the syntext. Thank you! "Jacob Skaria" wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data Search | Excel Programming | |||
search data? | Excel Discussion (Misc queries) | |||
Data Search | Excel Discussion (Misc queries) | |||
Data Search | Excel Worksheet Functions | |||
Search through Data | New Users to Excel |