Thread: Why #Name??
View Single Post
  #1   Report Post  
John Wirt
 
Posts: n/a
Default Why #Name??

Here is a simple user-defined function. It is the basic test for statistical
significance.

When I insert this code in a module in PERSONAL.XLS and use it in a cell in
an open workbook, I get the error message: #NAME?

If I insert this function in a module of the open workbook, it works.

Why doesn't this UDF work when inserted in PERSONAL.XLS?

Thank you.

John Wirt
---

Public Function SigTest(cell1, cell2, cell3, cell4)
Dim testval As Long

testval = (cell1 - cell2) * (cell1 - cell2)
testval = testval / (cell3 * cell3 + cell4 * cell4)
If testval 3.841447 Then
SigTest = "*"
Else
SigTest = ""
End If

End Function