Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search cell for string
Hi! I search column A in an excel file fo ra certain expression. The
expression might look like: G BP730 080708_88571. However the cell I am trying to locate will only contain part of this string eg G BP730 080708. How can I do this? Many thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search cell for string
Try this:
Sub arneee() Dim expression As String, v As String expression = "G BP730 080708_88571" Set r = Intersect(Range("A:A"), ActiveSheet.UsedRange) For Each rr In r v = rr.Value If InStr(expression, v) 0 And Len(v) 0 Then MsgBox (rr.Address & Chr(10) & rr.Value) Exit Sub End If Next End Sub -- Gary''s Student - gsnu200754 "Arne Hegefors" wrote: Hi! I search column A in an excel file fo ra certain expression. The expression might look like: G BP730 080708_88571. However the cell I am trying to locate will only contain part of this string eg G BP730 080708. How can I do this? Many thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search for string of characters in a cell | Excel Discussion (Misc queries) | |||
Search for string in a cell, then hilight the row | Excel Programming | |||
Using Vlookup in a string search of a cell | Excel Worksheet Functions | |||
search a string withing a string : find / search hangs | Excel Programming | |||
Search for a string sequence in a cell | Excel Programming |