View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default generating a #VALUE

Use the CVErr function to create an Error type Variant and return that as
the result of the function.

Function Whatever() As Variant
If Something Then
Whatever = CVErr(xlErrValue)
End If
End Function


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"Smallweed" wrote in message
...
I have a UDF which, if it can't find what it's looking for, I want to
return
and show #VALUE in the cell. Any ideas how do I do this? Thanks.