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.
Strangely enough when I started typing "=du" in the cell excel did find the function.
When I use the error checking function of excel this clearly shows that the function is not recognised.
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.
Can anyone tell me what I am doing wrong here?
Rename your module or your function. The module name and the function name cannot both be "Dummy".
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.