Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error trapping
Hi Group, I am having a hard time trapping an error and doing what I want to do next. I am looking up values on a worksheet and it is possible that the value will be "#N/A". I am comparing two values and the "#N/A" could be one of those values, so beta(b) = ERROR 2042. I would like to check if beta(b) does equal ERROR 2042 and then go to the bottom of my loop. Thanks for your help. David |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error trapping
Figured it out thanks.
David "David" wrote: Hi Group, I am having a hard time trapping an error and doing what I want to do next. I am looking up values on a worksheet and it is possible that the value will be "#N/A". I am comparing two values and the "#N/A" could be one of those values, so beta(b) = ERROR 2042. I would like to check if beta(b) does equal ERROR 2042 and then go to the bottom of my loop. Thanks for your help. David |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error trapping
It would be nice if you would share your solution with the group.
--JP On Jul 1, 3:17*pm, David wrote: Figured it out thanks. David "David" wrote: Hi Group, I am having a hard time trapping an error and doing what I want to do next. I am looking up values on a worksheet and it is possible that the value will be "#N/A". I am comparing two values and the "#N/A" could be one of those values, so beta(b) = ERROR 2042. I would like to check if beta(b) does equal ERROR 2042 and then go to the bottom of my loop. Thanks for your help. David |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error trapping
Hi JP, If IsError(alpha(a)) Then AlphaErrorCt = AlphaErrorCt + 1 GoTo erroralpha End If Hope that helps. Thanks, David "JP" wrote: It would be nice if you would share your solution with the group. --JP On Jul 1, 3:17 pm, David wrote: Figured it out thanks. David "David" wrote: Hi Group, I am having a hard time trapping an error and doing what I want to do next. I am looking up values on a worksheet and it is possible that the value will be "#N/A". I am comparing two values and the "#N/A" could be one of those values, so beta(b) = ERROR 2042. I would like to check if beta(b) does equal ERROR 2042 and then go to the bottom of my loop. Thanks for your help. David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error Trapping | Excel Discussion (Misc queries) | |||
Trapping #VALUE! error | Excel Discussion (Misc queries) | |||
while deleting rows it finds an error - error trapping | Excel Programming | |||
Error Trapping from WSH | Excel Discussion (Misc queries) | |||
error trapping | Excel Programming |