I'm trying to create a VBA function to call in a cell in Excel, but the cell comes up as #NAME?
when I enter =MyFunction("a")
In my VBA Module Module1
:
Public Function MyFunction(anything As String)
MyFunction = anything
End Function
in the cell:
=MyFunction("a")
Result:
#NAME?
What am I doing wrong here? When I start typing =MyFunction
in the cell, Excel lists it as an option, but doesn't show the parameters and then produces this result.
This is in a 2007 .xlsm
file.
Your UDF is in the correct place and is coded correctly and will be "recognized" if macros are enabled for the workbook in question!
Check your security settings.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments