#Name? Error in place of function result

  • Thread starter Thread starter Larry Serflaten
  • Start date Start date
L

Larry Serflaten

New to Excel VBA, old hand at VB, I am having trouble
calling a function from a cell.

What I want to do is update a cell every 2 minutes, where
I plan to use the OnTime method. So I added a function to
the sheet code module but it didn't work there. I then added
a separate module (Module1) and tried it there, but I still get
the #Name? as a response.

It seems the function is not visible from the cell.

What are the steps involved in creating a function that will
be callable from a cell, and, what topic in Help discusses
that task (I couldn't find anything relavent)

LFS
 
Gary''s Student said:
How have you coded the function and how are you using it in the cell?
--

The function is declared in a module like:

Public Function ChangingMessage()
.. code to build message
End Function

And I am trying to call it up from a cell like this:

=ChangingMessage()


But, as I said, what shows in the cell is "#Name?" (or something
similar)

LFS
 
If it had the same Function name when you tried in a Sheet Module, you get the #NAME error.
Try with a new name.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

|
| > How have you coded the function and how are you using it in the cell?
| > --
| > > It seems the function is not visible from the cell.
| > >
|
| The function is declared in a module like:
|
| Public Function ChangingMessage()
| .. code to build message
| End Function
|
| And I am trying to call it up from a cell like this:
|
| =ChangingMessage()
|
|
| But, as I said, what shows in the cell is "#Name?" (or something
| similar)
|
| LFS
|
|
 

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