Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Any way to word search in a Text Box?
I have text info in my excel text box, but I can't do a word search in
the text box. Any ideas. What about inside my cell notes? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Any way to word search in a Text Box?
On 9 Gru, 20:43, lbbss wrote:
I have text info in my excel text box, but I can't do a word search in the text box. Any ideas. What about inside my cell notes? You could convert the value into string and search using Instr for e.g. Can you post smoe code please? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Any way to word search in a Text Box?
maybe a subroutine like this...
Sub FindInTextBox(strFind As String) Dim s As Shape For Each s In ActiveSheet.Shapes If s.Type = msoTextBox Then If InStr(1, s.OLEFormat.Object.Caption, strFind, vbTextCompare) 0 Then MsgBox strFind & " found in " & s.Name s.Select Exit For End If End If Next s End Sub -- Hope that helps. Vergel Adriano "lbbss" wrote: I have text info in my excel text box, but I can't do a word search in the text box. Any ideas. What about inside my cell notes? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Any way to word search in a Text Box?
I tried pasting that routine into a vba macro, but it crashed before
the 0 Then line. Not sure how that macro should work. Where would you input the word you are searching for? tx |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Any way to word search in a Text Box?
The newsreader wrapped the code. Make sure the "If" up to the "0 Then" is
on one line.. This should be on one line: If InStr(1, s.OLEFormat.Object.Caption, strFind, vbTextCompare) 0 Then To use it, you would pass the word you are searching for as a parameter. For example, to look for "string1": FindInTextBox "string1" It will search for "string1" in text boxes in the active sheet. -- Hope that helps. Vergel Adriano "lbbss" wrote: I tried pasting that routine into a vba macro, but it crashed before the 0 Then line. Not sure how that macro should work. Where would you input the word you are searching for? tx |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help! Text word search. | Excel Discussion (Misc queries) | |||
search word or text in excel spreadsheet | Excel Discussion (Misc queries) | |||
Search text field for word | Excel Discussion (Misc queries) | |||
search for a specific word and copy the word and the preceeding words until a comma | Excel Programming | |||
trying to search 4 text in a word doc & print page? | Excel Programming |