In the same Workbook, I have defined the function:
Public Function toto(val As Integer) As Integer
toto = val * 2
End Function
Here is the editor view:
And in the Worksheet, in a cell, I use the formula:
But the result is (translation: #NAME?):
Also, in the VBA exec Window itself, opened from Excel, I get the following error when trying to execute:
toto(2)
Translation : Compilation error: Sub or Function not defined
What do I miss?





Valparameter is shadowing theVBA.Conversion.Valfunction and should probably be renamed.