Excel not finding VBA Function

DLeh

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.

Gary's Student

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Excel VBA .Find Function not finding a date

From Dev

finding a row in excel vba issue

From Dev

EXCEL VBA: finding lowest value in column

From Dev

Finding if a string is in a 2 dimensional VBA Excel array

From Dev

excel vba range.find not finding date

From Dev

finding the lowest value in a cell Excel VBA

From Dev

Finding Last Row using Excel VBA

From Dev

Finding element using asterisk in HTML with VBA Excel

From Dev

Finding a function definition in MS Access VBA editor

From Dev

Excel function to VBA

From Dev

Excel VBA and Group function

From Dev

Sub or Function in VBA Excel

From Dev

VBA Excel If statement with AND/OR function

From Dev

Find Function in Excel VBA

From Dev

Automate a Excel VBA Function

From Dev

Excel VBA hlookup function

From Dev

Excel VBA and Group function

From Dev

Round function VBA EXCEL

From Dev

VBA Excel Finding and Combining Rows Based on Matching Column Cells

From Dev

Finding Average and Standard Deviation on displayed, filtered data in Excel Using VBA

From Dev

Finding the LastRow from Excel Attachment via Outlook VBA

From Dev

Optimizing VBA / Excel Macro Code (Finding Duplicates in Large Sheet)

From Dev

Excel VBA finding matching cell in another sheet in same book

From Dev

VBA Excel; Finding Duplicate Cells and Populating an Offset Cell

From Dev

Finding the LastRow from Excel Attachment via Outlook VBA

From Dev

VBA Excel - Variable "Double" as function

From Dev

Searching for function usage in Excel VBA

From Dev

#NAME? error in Excel for VBA Function

From Dev

excel VBA return result of function