help on UDF code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following code to create a UDF to calculate reciprocals:

Function Reciprocal(a)
Reciprocal(a) = (1 / a)
End Function

The code is in a module.

I get #VALUE! errors when I try to run it. So I think this means that Excel
recognizes the UDF (otherwise it would return a #NAME error, right?)

So what's the problem here?
 
Avoid the appearance of recursion:

Function Reciprocal(a)
Reciprocal = (1 / a)
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top