简体   繁体   中英

UDF is not recognised in excel 2010

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM