Hi Jørgen,
Why should you be any different to other users?
Version 3 and counting!
Sub SearchForName()
Dim FoundCell As Range
Dim FoundFirst As Range
Dim StartAt As Range
Dim CellWithName As String
Dim sFirst As String
With Worksheets("Sheet1")
CellWithName = .TextBox1.Text
If Trim(CellWithName) = "" Then
MsgBox "Please type something"
Exit Sub
End If
If LCase(ActiveCell.Value) Like LCase(CellWithName & "*") Then
Set StartAt = ActiveCell.Offset(1, 0)
Else
Set StartAt = Range("A2")
End If
With .Range("A2", .Cells(.Rows.Count, "A").End(xlUp))
Set FoundCell = .Cells.Find(What:=CellWithName, _
After:=StartAt, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False)
End With
If FoundCell Is Nothing Then
MsgBox "not there"
Else
Application.Goto reference:=FoundCell, Scroll:=True
End If
End With
End Sub
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
"kandinsky " wrote in message
...
Oh yeah, I can see that it might be a good idea if i told you what I
wanted before I asked you to help with it, he he
Iv'e got a customerlist with several thousand names, and I have my
sales rep's names with them etc.
I am trying to make it easy to type in part of a customer name, and
then just click the search button until the right one comes up.
If I fx know that the customers name is something with the word
"Xtreme" in it, but don't quite remember the whole name, I'll just type
"xtreme" and then click search until I recognize the right record.
(Like a "find next" thing)
Right now i can click several times, and it will only go to the first
recognized record...
Did that make sence?
Regards,
Jørgen Lindegaard
---
Message posted from http://www.ExcelForum.com/