Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search for a string sequence in a cell
Hi All,
Is there a way to search a cell for a chunk of text? with VBA ex look for here in "Hi There" since it is there highlight that cell. I can only seem to get exact matches Thanks Chad |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search for a string sequence in a cell
Hi Chad,
Not sure the entire context of what you are dealing with, but you can use the InStr function to do this. Syntax is as follows ... Instr(1, LookAt, LookFor) It will return a whole number (starting position) of matched text. If no match is found, a 0 value is returned. You can test for a cell value like this .... If InStr(1, Range("A1"), "Hello") 0 Then Msgbox "Was found in A1." -- Regards, Zack Barresse, aka firefytr "CLS" remove NOT wrote in message ... Hi All, Is there a way to search a cell for a chunk of text? with VBA ex look for here in "Hi There" since it is there highlight that cell. I can only seem to get exact matches Thanks Chad |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search for a string sequence in a cell
Record a Macro doing a "Find" (Edit - Find or Ctrl + F). Look at the results
and make any modifications you may need... If something still is not working post a reply back with the code and we can look at it for you... HTH "CLS" wrote: Hi All, Is there a way to search a cell for a chunk of text? with VBA ex look for here in "Hi There" since it is there highlight that cell. I can only seem to get exact matches Thanks Chad |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search for a string sequence in a cell
Another method that works well is using AutoFilter for your group and then
processing with SpecialCells. Very quick, very easy - once you get the hang of it. And I agree with Jim, the Find method is very, very fast. You would get more results and a better solution if you posted your entire quandry. -- Regards, Zack Barresse, aka firefytr "CLS" remove NOT wrote in message ... Hi All, Is there a way to search a cell for a chunk of text? with VBA ex look for here in "Hi There" since it is there highlight that cell. I can only seem to get exact matches Thanks Chad |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Create a cell that will search multiple sheets for entered string. | Excel Discussion (Misc queries) | |||
Search a string in a cell for a list of 3 letter codes | Excel Worksheet Functions | |||
Search for string of characters in a cell | Excel Discussion (Misc queries) | |||
FIND / SEARCH text compare cell to string in 3rd cell | Excel Discussion (Misc queries) | |||
Using Vlookup in a string search of a cell | Excel Worksheet Functions |