Thank You, This is what I was looking for.
--
Bernie
"JLGWhiz" wrote:
> Put this line at the beginning of the problem code segment:
>
> On Error GoTo ErrHandler:
>
> Then put this code near the end of the macro.
>
> ErrHandler:
> MsgBox "Error Number " & Err.Number & " Has Occurred. Restart Macro"
> Err.Clear
>
> This gives you the error number which you can evaluate before restarting.
>
>
>
> "brichard429" <(E-Mail Removed)> wrote in message
> news:4B9FF360-08F3-49E3-B62C-(E-Mail Removed)...
> >I have a sub routine that may generate an error if a value is not defined.
> > While developing the code I've come accross the error and get an error
> > statement. I have to reset the code by selecting the reset button in the
> > VBA
> > window to get it to work again. It's not a code issue but a data issue.
> > I'm
> > not looking for a way to correct the data but I would like to use an error
> > handler to simply display a message and return the control back to the
> > spreadsheet so that the routine can run again without having to go to the
> > Debug window and resetting the code. Any suggestion?
> >
> > Thank You,
> > --
> > Bernie
>
>
> .
>
|