to all,
rather than writing a "complicated" formula in a cell, I am writing a function. I am trying to understand wha tis the best way of checking if a value as been specified for an input.
I set up my test with IsMissing() but the input must be a Varian. I am working with Double
In my test I wan to make sure that the input has been specified or it's not zero. The zero part works
rather than writing a "complicated" formula in a cell, I am writing a function. I am trying to understand wha tis the best way of checking if a value as been specified for an input.
I set up my test with IsMissing() but the input must be a Varian. I am working with Double
In my test I wan to make sure that the input has been specified or it's not zero. The zero part works
Code:
Function test1(inputvalue As Double) As String
Dim msg As String
If inputvalue = 0 Then 'IsMissing(inputvalue) only work for Variant
Debug.Print ; "value is missing"
Debug.Print ; inputvalue
msg = "value is missing"
Else
msg = "value is: " & inputvalue
End If
MsgBox msg
test1 = msg
End Function
Last edited by a moderator: