![]() |
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 |
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. |
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 |
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 |
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 |
All times are GMT +1. The time now is 10:28 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com