View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default UDF Raising an error

Option Explicit
Function myFunc(myVal As Variant) As Variant

If IsNumeric(myVal) Then
myFunc = myVal * 2
Else
myFunc = CVErr(xlErrNA)
End If

End Function



DMc2005 wrote:

Hi

How can i get a user defined function to return an error code like #n/a.

many thank

d


--

Dave Peterson