View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Nenad Tosic Nenad Tosic is offline
external usenet poster
 
Posts: 5
Default please help about handling "#NUM!" error !

Thanks, Ron !! I was a little bit too impatient (I could not "see" reply
from Dave Peterson
and (especially) Chip Pearson, who proposed me to use Err.Number (I got
status 1004
when error occured and 0 when everything was OK) instead of Daves' proposal
to use
"if iserror(<function) then ..."). I used both of them to find two UDFs (I
will test which
is faster, because the logics of both UDFs is the same). I will also try to
use "IfError()",
but later...

(I am not sure, but I think that I have already experimented with
"IfError()").

Nenad

"Ron Rosenfeld" wrote in message
...
You could try using the Evaluate method.

e.g.:

====================================
Option Explicit
Sub TestError()
Dim r As Variant

r = WorksheetFunction.IfError(Evaluate("IRR({10,20})") , -5)

Debug.Print r
End Sub
=======================================

will print -5 even though the formula gives a #NUM error.
--ron