Sub MyReplace()
Dim rw As Long
With ActiveSheet
On Error Resume Next
rw = Application.WorksheetFunction.Match(.Range("B13"), .Range("B4:B7"), 0)
On Error GoTo 0
If rw > 0 Then
.Range("C" & rw + .Range("B4:B7").Row - 1).Value = .Range("C13")
Else
MsgBox "Name not found in range"
End If
End With
End Sub
6
solved How do I use vlookup in VBA to enter a value into that cell [closed]