Formula calling a function problem

  • Thread starter Thread starter grovesy
  • Start date Start date
G

grovesy

Can someone please tell me what im doing wrong?

I have written a very simple function:


Code
-------------------

Function foo() As String
foo = "hello"
End Function

-------------------



Then I wish to call this function from a cell like a formula so in tha
cell i write:

=foo()

But all i get in the cell is #Name?

I have tried placing the function code in both the sheet code area an
the workbook code area but nothing works.

Any ideas
 
I found the answer, it is because the code has to be in a module.
don't think this point is very well documented!!

Also can anyone explain why all my posts have a different letter symba
than everyone elses! My symbal always appears closed with a seal o
it???

Cheers
Chri
 

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