Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Searching using part of a word rather than whole word in vba
Thank you for all the help, but I've figured it out.. thought I'd put i here for the benifit of others: Dim count as integer dim name as string dim vlookup as integer 'this is simply a counter for position o worksheet dim done as integer count = textbox1.TextLength name = Left((Sheet1.Cells(2, 1)), 3) Do Until done = 1 name = Left((Sheet1.Cells(Vlookup, 1)), count) If name = "" Then done = 1 ElseIf name = Left(textbox1.Text, count) Then With Me.listbox1 .AddItem Sheet1.Cells(Vlookup, 3) .List(.ListCount - 1, 1) = Sheet1.Cells(Vlookup, 1) .List(.ListCount - 1, 2) = Sheet1.Cells(Vlookup, 2) .List(.ListCount - 1, 3) = Sheet1.Cells(Vlookup, 4) End With End If Vlookup = Vlookup + 1 Loop -- Devit ----------------------------------------------------------------------- Devitt's Profile: http://www.excelforum.com/member.php...fo&userid=1442 View this thread: http://www.excelforum.com/showthread.php?threadid=26840 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
searching for a word(s) within a list | Excel Discussion (Misc queries) | |||
highlight the word when excel finds text you are searching for | Excel Worksheet Functions | |||
Is Excel or Word better for holding and searching data | Excel Discussion (Misc queries) | |||
searching a cell for a contained text word | Charts and Charting in Excel | |||
Searching using part of a word rather than whole word in vba | Excel Programming |