This should do it
Sub abc()
Const shArk1 As String = "Ark1"
Const shArk2 As String = "Ark2"
Dim FoundCell As Range
Dim sName As String, sAge As String, sWeight As String
With Worksheets(shArk2)
sName = .Range("c16").Value
sAge = .Range("e16").Value
sWeight = .Range("f16").Value
End With
If Not sName <> "" Then Exit Sub
With Worksheets(shArk1)
Set FoundCell = .Range("h:h").Find(What:=sName, LookAt:=xlWhole)
If Not FoundCell Is Nothing Then
FoundCell.Offset(, -5) = sAge
FoundCell.Offset(, -1) = sWeight
Else
MsgBox "Name not found."
Exit Sub
End If
End With
MsgBox "Update succesful."
With Worksheets(shArk2)
.Range("c16").ClearContents
.Range("e16").ClearContents
.Range("f16").ClearContents
End With
End Sub
Bookmarks