Does your UDF assign a value to the function? Is the function part of a class module? The following code, inside of a class module in an ActiveX dll project, would (I think; I didn't test it!) return either a 1 or a 2, based on the parameter passed in by the user:
Public Function MyFunction(varUserParm as variant) as Integer
If varUserParm = "Y" then
MyFunction = 1
Else
MyFunction = 2
End if
End Function
That's not exactly an inspired example, but it illustrates the idea.