Textbox - search

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
 
T

Tom Ogilvy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top