hi,
i am doing an phone book on excel ....and i need a macro that search for the cells that contains a name..but the problem is i don't want it to be accurate....i need to type part of the name and it finds me all cells that contain that part
A1 A2 A3
1 name phone
2
3
here is a function i already had...but the problem is that its too accurate
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Search4 As Range, Found As Range
'
Set Search4 = Range("A4")
'
On Error Resume Next
If Target(1, 1).Address = Search4.Address Then
Set Found = Cells.Find( _
What:=Search4, _
After:=Search4, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
If Found.Address = Search4.Address Then
MsgBox "No match found."
Else
Found.Select
End If: End If
End Sub
Bookmarks