Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search for text value in range
I'm looking for an efficient method to search for a text value. I have
a named range. Let's say range = A7:A14. I want to check cells C7:C14 to find the first cell whose value matches a previously populated variable. It's possible that none of the cells have that value in it. It seems that I could use a for all loop but I can't seem to get the syntax right. I've already got a ton of named ranges. I'm trying to avoid setting up a bunch more. Any ideas?? TIA |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search for text value in range
Tig, I don't know if this is what your looking for, but give this code a
shot. hth , Rick Sub FindDup() Dim dupRng As Range, fndRng As Range Dim x As Long Set dupRng = Range("A7:A14") x = 7 '' start row Do Until IsEmpty(Cells(x, "C").Value) Set fndRng = dupRng.Find(what:=Cells(x, "C").Value) If Not fndRng Is Nothing Then MsgBox ("Duplicate Found at = " & fndRng.Address) Exit Sub End If x = x + 1 Loop MsgBox ("No Duplicates Found") End Sub "tig" wrote in message oups.com... I'm looking for an efficient method to search for a text value. I have a named range. Let's say range = A7:A14. I want to check cells C7:C14 to find the first cell whose value matches a previously populated variable. It's possible that none of the cells have that value in it. It seems that I could use a for all loop but I can't seem to get the syntax right. I've already got a ton of named ranges. I'm trying to avoid setting up a bunch more. Any ideas?? TIA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search for specific text within last non blank cell in a range | Excel Worksheet Functions | |||
Search for Condition, Text based, Date Range, Occurrences | Excel Worksheet Functions | |||
Search range for text not in another range | Excel Discussion (Misc queries) | |||
Search Range for item in seperate range | Excel Programming | |||
Can Range.Find search a Cells' Text property? | Excel Programming |