Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Finding text in a string

Hi, Using XL2000

Each cell in Col A contains a random selection of words, such as steel,
brass, aluminium. Comma seperated.
Col B contains user names.
There are upto 500 rows.

The same Words in featured in Col A exist in ComboBox1 in Userform1.
The user selects a word from the list in CB1.

On a click event, I need each row searched and where a text match is found
in each cell in Col A, the contents of Cell B1 are displayed in ListBox1

That is..

At a qualifying row; If A1 contains Steel, Brass, Aluminium AND Steel is
selected from CB1
Listbox1 displays the content of B1

Any VBA ideas appreciated.
Many thanks,

Paul



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Finding text in a string

Dim rng as Range, cell as Range
With Userform1
set rng = Range(Cells(1,1),Cells(1,1).End(xldown))
for each cell in rng
if instr(1,cell.Value, .cb1.text, vbTextCompare) then
.listbox1.AddItem cell.offset(0,1)
end if
Next
End With

If you have possible choices such as Steel and Eel, then you would have to
have additional tests.

--
Regards,
Tom Ogilvy

"Paulc" wrote in message
...
Hi, Using XL2000

Each cell in Col A contains a random selection of words, such as steel,
brass, aluminium. Comma seperated.
Col B contains user names.
There are upto 500 rows.

The same Words in featured in Col A exist in ComboBox1 in Userform1.
The user selects a word from the list in CB1.

On a click event, I need each row searched and where a text match is found
in each cell in Col A, the contents of Cell B1 are displayed in ListBox1

That is..

At a qualifying row; If A1 contains Steel, Brass, Aluminium AND Steel is
selected from CB1
Listbox1 displays the content of B1

Any VBA ideas appreciated.
Many thanks,

Paul





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding a character in a text string (take3) Bulent Excel Discussion (Misc queries) 2 October 31st 07 02:35 PM
Finding a charcter in a text string caldog Excel Worksheet Functions 3 October 7th 07 04:37 AM
Finding specific text in a string Hardip Excel Worksheet Functions 5 April 8th 06 01:16 PM
Finding a text string w/in a Cell ricxl Excel Discussion (Misc queries) 12 March 20th 06 03:47 AM
Finding Specific Text in a Text String Peter Gundrum Excel Worksheet Functions 9 April 10th 05 07:21 PM


All times are GMT +1. The time now is 06:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"