I have an Excel 2016 VBA UDF (user-defined function) that looks this;
Public Function AddUDF(Param1 As Single, Param2 As Single)
'Code implementation
End Function
Contents in Cell A1, A2 are inputs to the arguments Param1, Param2.
When cells A1 and A2 contains numbers, the UDF runs normally as expected. When one of the cells contains a string such as "N.A", this UDF is not run and the value #VALUE! is returned. I know the UDF is not run because I put a breakpoint into the UDF and the breakpoint is not reached at all.
How do I get the UDF to run?
Rangeand handleRange.Valueexceptions accordingly, but if you would use it like=AddUDF($A$1, 16.5)then you'll needVariantparams. - David Zemens