My code is as follows:
Function myFunc(Optional i) As Integer
If IsMissing(i) Or i = 1 Then
myFunc = 1
Else
myFunc = 0
End If
End Function
It returns #VALUE! if the function is called without parameter myFunc().
Because of that I have to use the more complicated code:
Function myFuncWorking(Optional i) As Integer
If Not IsMissing(i) Then
If i = 1 Then
myFuncWorking = 0
End If
Else
myFuncWorking = 1
End If
End Function
Is it possible to overcome this issue?