View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Maurizio Borrelli Maurizio Borrelli is offline
external usenet poster
 
Posts: 10
Default Throwing #Value in a UDF written in Excel VBA

Il giorno giovedì 21 febbraio 2013 20:11:38 UTC+1, Dom ha scritto:

Hi,
try

Public Function m(a)
'...
m = CVErr(xlErrValue)
End Function

I just wrote a UDF in excel's VBA. If the arguments are wrong, I'd
like to have #Value appear in the cell. Is there a way to throw this
exception in a VBA function?