B
BillCPA
What causes the 'On Error GoTo xxx' to work sometimes and not to work other
times.
I have a loop that contains an On Error statement. The first time through
the loop the code encounters a cell with data that causes an error, and the
On Error statement handles it - it sends the code to the designated label,
where I have an 'On Error GoTo 0' statement. The next time through the loop,
the 'On Error' Statement is again set, and the code encounters the next cell,
which has exactly the same data as the previous cell. This time an error
message pops up instead of the On Error statement handling the error.
I have tried using 'Err.Clear', but that doesn't seem to work either.
Also, are there certain errors that 'On Error' doesn't handle? I have tried
using it before trying to select a worksheet that does not exist, and I get
an error message rather than the 'On Error' handling it.
I can work around most of these problems, but I'd like to know what I'm not
doing correctly.
times.
I have a loop that contains an On Error statement. The first time through
the loop the code encounters a cell with data that causes an error, and the
On Error statement handles it - it sends the code to the designated label,
where I have an 'On Error GoTo 0' statement. The next time through the loop,
the 'On Error' Statement is again set, and the code encounters the next cell,
which has exactly the same data as the previous cell. This time an error
message pops up instead of the On Error statement handling the error.
I have tried using 'Err.Clear', but that doesn't seem to work either.
Also, are there certain errors that 'On Error' doesn't handle? I have tried
using it before trying to select a worksheet that does not exist, and I get
an error message rather than the 'On Error' handling it.
I can work around most of these problems, but I'd like to know what I'm not
doing correctly.