I have a long list of customer information, which will include many similar names. I'd like to be able to first search and find a matching entry based on a name input (either partial or complete), then have a Yes/No if it is the right one. If yes, then copy that row to another sheet in the same workbook, if not, continue searching through the list. I've started the search as follows:
Sub SearchName()
Dim SearchValue As String
On Error Resume Next
SearchValue = InputBox("Enter Name")
If IsError(Cells.Find(What:=SearchValue, After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Activate) = True Then
.FindNext (SearchValue)
MsgBox ("Name Not Found")
End If
End Sub
I cant get the .findnext to work, and I dont know where to start with the copy row. Anyone willing to head me down the right path?
Thanks
Sub SearchName()
Dim SearchValue As String
On Error Resume Next
SearchValue = InputBox("Enter Name")
If IsError(Cells.Find(What:=SearchValue, After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Activate) = True Then
.FindNext (SearchValue)
MsgBox ("Name Not Found")
End If
End Sub
I cant get the .findnext to work, and I dont know where to start with the copy row. Anyone willing to head me down the right path?
Thanks