Textbox - search

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

I dont know how to do one thing.
I have filled column with some data (text).

i would like to create a search module.
in one textbox i want to enter letters and in another textbox (or list)
i want to see first matched name.

example:
1 aaaaaa
2 aaabbb
3 abbccc
4 aabbaa

if i enter a i would like to see 1
if i enter aaab i would like to see 2
i dont want to enter the whole phrase to see matched cell.
please help me
thanks in advice
 
Look at the find command

Dim rng as Range
set rng = Range("A1:A500").find(what:=Textbox1 & "*", _
After:=Range("A65536"), Lookin:=xlValues, _
Lookat:=xlWhole, SearchOrder:=xlbyColumn, _
SearchDirection:=xlNext, MatchCase:=False)
if not rng is nothing then
textbox2.Value = rng.row
Else
textbox2.value = 0
End if
 
Back
Top