View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Devitt[_4_] Devitt[_4_] is offline
external usenet poster
 
Posts: 1
Default 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