Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
UDF Returning #N/A
With a user defined function saved in an *.xla add-in...
How can I make the function return the worksheet error value #N/A? as an example (that doesn't work) Function MyFunction(x,y, optional z) MyFunction = application.worksheetfunction.NA() End Function |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
UDF Returning #N/A
On Fri, 21 Oct 2005 18:41:02 -0700, KAHAUS
wrote: With a user defined function saved in an *.xla add-in... How can I make the function return the worksheet error value #N/A? as an example (that doesn't work) Function MyFunction(x,y, optional z) MyFunction = application.worksheetfunction.NA() End Function Function foo() foo = CVErr(xlErrNA) End Function --ron |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
UDF Returning #N/A
something like:
Option Explicit Function MyFunction(x, y, Optional z) As Variant If IsMissing(z) Then MyFunction = CVErr(xlErrNA) Else MyFunction = z End If End Function KAHAUS wrote: With a user defined function saved in an *.xla add-in... How can I make the function return the worksheet error value #N/A? as an example (that doesn't work) Function MyFunction(x,y, optional z) MyFunction = application.worksheetfunction.NA() End Function -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
UDF Returning #N/A
Both Ron & Dave: Thanks, works great! Ive been searching for CVErr for days!
"Dave Peterson" wrote: something like: Option Explicit Function MyFunction(x, y, Optional z) As Variant If IsMissing(z) Then MyFunction = CVErr(xlErrNA) Else MyFunction = z End If End Function KAHAUS wrote: With a user defined function saved in an *.xla add-in... How can I make the function return the worksheet error value #N/A? as an example (that doesn't work) Function MyFunction(x,y, optional z) MyFunction = application.worksheetfunction.NA() End Function -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Returning a zero | Excel Discussion (Misc queries) | |||
UDF returning #VALUE! why? | Excel Discussion (Misc queries) | |||
=if returning 0 | Excel Worksheet Functions | |||
Returning a 0 Value | Excel Worksheet Functions | |||
If/Then help in returning value | Excel Programming |