2

I am having a problem with incorporating User Defined Functions in excel. For some reason the function is not recognised. The (simplified) code is as follows:

Option Explicit
Option Base 1

Function Dummy(A As Range, _
               B As Range, _
               C As Double, _
               D As Double) As Double

' This function doesn't do anything

End Function

When I use the function in a cell it returns the #NAME? error.enter image description here

Strangely enough when I started typing "=du" in the cell excel did find the function.enter image description here

When I use the error checking function of excel this clearly shows that the function is not recognised.enter image description here

I know this error can occur in case the VBA module is stored in a user form, a sheet or "ThisWorkbook". However that is not the case here.enter image description here

Can anyone tell me what I am doing wrong here?

1 Answer 1

4

Rename your module or your function. The module name and the function name cannot both be "Dummy".

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. I knew it had to be something simple. I just didn’t expect it to be so ridiculously simple. Is there any good resource that can help in identifying the source of errors? The help function of excel and the Excel VBA reference aren’t very useful in this regard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.