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.