Newbee Q: How to make search field in excel sheet?

K

kandinsky

Hi.
I am using Excel in a rather stupid way. I work in sales and have all
my company leads in here, so I can keep them in check. What I would
like to have though, is a field where I can type part of a company
name, and then the Excel ark goes to the first cell that matches...

It seems so simple, but I have almost never used Excel before, so I'm
lost...

Any quick tips out there?
 
K

kandinsky

Yup... That's actually the functions i'm lookng for, but for reasons I
don't really understand myself, I would like to implement the funktion
into a textfield+submit button...

Any ideas?

(Except the obvious "Use another more apropiate program for that
stuff"... )
 
B

BrianB

Try this :-

'------------------------------------------------------
Sub FINDER()
Dim Foundcell As Object
Dim FindValue As String
FindValue = InputBox("Enter data to find ")
If FindValue = "" Then End
'--
Set Foundcell = ActiveSheet.Cells.Find(what:=FindValue, _
after:=[A2], LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, MatchCase:=False)
If Foundcell Is Nothing Then
MsgBox ("Could not find " & MyValue)
Else
x = Foundcell.Address
Application.Goto reference:=Range(Foundcell.Address)
End If
End Sub
'------------------------------------------------------
 

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