In vba something along these lines?:
Sub sequently()
On error GoTo gonewrong
Debug.Print Application.WorksheetFunction. _
VLookup(Range("G10"), Range("D10:E17"), 2, False)
On Error GoTo 0
Exit Sub
gonewrong:
MsgBox "yuk!"
End Sub
The On Error statement applied just before the vlookup statement, then
cancelled straight after that statement with On Error GoTo 0 (Actually
unnecessary above as the vlookup statement is the only one and On
Error statements are cancelled on exit from the procedure they were
used in!).
In this case the On Error statement, when met by any error, will
divert to the code after the label 'gonewrong'.
To prevent that portion of code being executed inappropriately (when
there is no error), the Exit Sub line is inserted just before it.
ps Debug.Print prints to the immediate window in the VBE; Ctrl+G in
the VBE if you can't see it.