Thread: Error trapping
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JP[_4_] JP[_4_] is offline
external usenet poster
 
Posts: 897
Default Error trapping

You might want to post the code you're currently using. If I
understand your problem correctly, you want to trap Err.Number 2042.
There are (at least) two ways to do it. The simplest way is to use On
Error Resume Next before the "problem statement" (the one likely to
cause the error) then check if the error occurred.

Ex:

On Error Resume Next
x = x / 0
If Err.Number = 2042 Then
' take action if error occurs
End If
On Error GoTo 0


HTH,
JP

On Jul 1, 2:16*pm, David wrote:
Hi Group,

I am having a hard time trapping an error and doing what I want to do next.