avoiding debug error

R

R D S

Hi,

I have a speadsheet with a userform into which items being ordered are
entered.
Clicking OK launches another form with pricing info displayed thanks to
VLOOKUP.
All works a treat until we enter something in error which isnt in the
VLOOKUP data range, at which point the debug error box pops up.

What is the best way to overcome this? Any ideas appreciated.

Many thanks,
Rick
 
R

R D S

Alan Beban said:
What do you want to happen instead?

Alan Beban

Anything more desirable. And easy for a novice to deal with.
Preferably a backtrack to amend the info or at least a return to a clear
form 1.

Rick
 
P

pfsardella

Substitute you 'Lookup' statement :

If IsError(Application.VLookup(rngS, rngList, 14, False)) Then
MsgBox "There is no item with this name."
' Then, clear whatever on the original form. Maybe clear the text
' box and select the text box?
Else
'Launch your form.
End If

HTH
Paul
 
A

Alan Beban

R said:
Hi,

I have a speadsheet with a userform into which items being ordered are
entered.
Clicking OK launches another form with pricing info displayed thanks to
VLOOKUP.
All works a treat until we enter something in error which isnt in the
VLOOKUP data range, at which point the debug error box pops up.

What is the best way to overcome this? Any ideas appreciated.

Many thanks,
Rick
What do you want to happen instead?

Alan Beban
 
Top