View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default UDFs return #NAME error sometimes, other times, they work

Just a guess...

Next time you see the #name error, select that cell and see what the formula
says.

Does it point to the correct workbook?

Second guess...
Do you use other UDF's? If yes, do any of them have any errors that cause them
to break? Maybe excel stops calculating when the other UDF breaks.

Dave F wrote:

So I have a spreadsheet with a bunch of cells that use a UDF. Sometimes when
I open the spreadsheet, some of the cells that have this UDF show a #NAME
error. Pressing F9 seems to clear these errors.

Is there some setting which forces UDFs to calculate automatically?

This is the code I'm using, if curious:

Function GetFormula(Cell As Range) As String
GetFormula = Cell.Formula
If Cell.HasArray Then GetFormula = "{" & GetFormula & "}"
End Function

If I eliminate the If...Then clause I still sometimes get the #NAME error,
sometimes not. So the code I have is not creating the error, so far as I can
tell...

Ideas?

--
Brevity is the soul of wit.


--

Dave Peterson