Hi Daniel,
This code might help you do the trick.
Sub myFind()
Range("A1:D10").Select
myValue = InputBox("Please enter value")
Selection.Find(What:=myValue, _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False).Activate
End Sub
Regards
Steven
Sub Macro2()
'This will search your sheet for any cell containing a portion of your input.
'You can continue your search from the last find and the location of the find is activated on the sheet.
'This was designed to work as a Form Button or a Hot-Key.
'By: Joe Was, 11/2001
Dim mySearch As String
Dim myData As String
Dim Searchl As Integer
Dim Datal As Integer
Dim PofText
Dim LofText
'Get user search info.
mySearch = Application.InputBox("Enter your search text:", Title:="Fuzzy Match, from the Active Cell", Type:=2)
'Search Sheet, from current cursor location out as case sensitive and as part of a cell entry.
Cells.Find(What:=mySearch, After:=ActiveCell, LookIn:=xlValues, LookAt:=xlPart, _
SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=True).Activate
'Locate cell with match.
Cells.FindNext(After:=ActiveCell).Activate
'Count find lengths and calculate percent.
myData = ActiveCell
Searchl = Len(mySearch)
Datal = Len(myData)
If Datal <= Searchl Then
LofText = (Datal / Searchl)
Else
LofText = (Searchl / Datal)
End If
PofText = FormatPercent(LofText)
'Display found data and display percent of match.
MsgBox "A Match is: '" & myData & "', a fuzzy match of: " & PofText & "."
End Sub
You can change this to not do a "Fuzzy" search by changing "xlPart" to "xlWhole." JSW