Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Searching a String
I have a list of ID numbers. They are as follows
bttest12 bttest45 cttest12 bttest45 Ok in VBA say that i wanted to search this row of strings using a short segment of the strings Inputbox1="ct I would like to return the values that contain the letters "ct" to a listbox Thanks for any help |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Searching a String
Try this
With Worksheets("Sheet1") On Error Resume Next Set oCell = .Range("A1:A50").Find(what:="ct", lookat:=xlPart) If Not oCell Is Nothing Then sFirst = oCell.Address Do .listboxes("List Box 1").additem oCell.Value Loop While Not oCell Is Nothing And oCell.Address < sFirst End If End -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "dcstech" wrote in message ... I have a list of ID numbers. They are as follows: bttest123 bttest456 cttest123 bttest456 Ok in VBA say that i wanted to search this row of strings using a short segment of the strings. Inputbox1="ct" I would like to return the values that contain the letters "ct" to a listbox. Thanks for any help. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Searching a String
Thanks for the help
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
help on sumproduct() - sum by searching for a common sub string in | Excel Worksheet Functions | |||
Formula for searching for a text string | Excel Discussion (Misc queries) | |||
Searching for string in other cells | Excel Worksheet Functions | |||
searching and summing using string within cell | Excel Discussion (Misc queries) | |||
searching a string with a partial string | Excel Programming |