ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Searching using part of a word rather than whole word in vba (https://www.excelbanter.com/excel-programming/313241-searching-using-part-word-rather-than-whole-word-vba.html)

Devitt[_4_]

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



All times are GMT +1. The time now is 06:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com