Here is a simple code for that
Function Snippet_For_Copy(sSearchString)
If Trim(sSearchString) = "" Then Exit Function
With sheets(1).Columns("A:A")
Set rFindCell = .Find(sSearchString, LookIn:=xlValues, LookAt:=xlWhole)
If Not rFindCell Is Nothing Then
sheets(1).Rows(rFindCell.Row).EntireRow.Copy _
Destination:=Range("A" & ActiveCell.Row)
End If
End With
End Function
You can trigger the function using Worksheet_SelectionChange event
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If IsNumeric(Target) = False Then Exit Sub
If Trim(Target) = "" Then Exit Sub
Application.EnableEvents = False
Snippet_For_Copy Target.Value
Application.EnableEvents = True
End Sub
Cheers
Shasur
http://www.vbadud.blogspot.com