ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to cause a #num! error (https://www.excelbanter.com/excel-programming/364418-how-cause-num-error.html)

Ken Kazinski

How to cause a #num! error
 
Hi,

Is there a way to have a function return a error message? I would like one
of my functions to return a #num! error when the range passed to it is empty.

Thanks,

Ken


Andrew Taylor

How to cause a #num! error
 

Function ReturnsHashNum()
ReturnsHashNum = CVErr(xlErrNum)
End Function

There are other error consts if you need them- xlErrNA.
xlErrDiv0, etc

Andrew



Ken Kazinski wrote:
Hi,

Is there a way to have a function return a error message? I would like one
of my functions to return a #num! error when the range passed to it is empty.

Thanks,

Ken



Ken Kazinski

How to cause a #num! error
 
Thanks that gave an error in the cell - just not a num error.




Dave Peterson

How to cause a #num! error
 
It returned #NUM! for me.

What did you get?

Ken Kazinski wrote:

Thanks that gave an error in the cell - just not a num error.


--

Dave Peterson


All times are GMT +1. The time now is 02:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com