I have a data table in Excel, that is same as:
A B
-------------
1. aaa 11
2. bbb 22
3. ccc #N/A
4. ffffd 44
I\'ve
You can handle the error as below.
Although I suggest you look consider using a more versatile Find
in place of Application.VLOOKUP
Sub TestMe()
Dim vTest As Variant
vTest = Application.VLookup("TesT", Range("A1:B10"), 2, False)
If IsError(vTest) Then
MsgBox "Not found", vbCritical
Else
MsgBox "value is " & vTest
End If
End Sub