Home |
Search |
Today's Posts |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 8 Apr 2006 01:50:15 -0700, "Bondi" wrote:
Hi Richard, In another thread some time ago i found that VLookup() produces a runtime error when the value can not be found. You can use the following to snap that event. Code: On Error Resume Next 'VLookUp() If Err.Number < 0 Then 'If not found Debug.Print Err.Number Debug.Print Err.Description Else ' If found End If On Error Goto ErorrHndl Regards, Bondi Hi Bondi Thanks for that suggestion, I hadn't thought of trapping the error number and using that - rather neat. It also avoids the problem of forcing the program flow to an error handler, which by definition is outside any Looping part of the Procedure. Regards PS, thanks also to the others who responded. __ Richard Buttrey Grappenhall, Cheshire, UK __________________________ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I want to trap an error I get in a macro | Excel Programming | |||
Error Handling - On Error GoTo doesn't trap error successfully | Excel Programming | |||
Error Trap | Excel Programming | |||
error trap | Excel Programming |