Share via

#NAME? error when calling a user defined function (UDF)

Anonymous
2016-08-06T16:33:25+00:00

I am getting a #NAME? error when calling a function from within a cell in sheet11 that is defined in Module1 as public.

Public Function bScoresAreEntered() As Boolean

    bScoresAreEntered = False

End Function

The cell equation is

=IF(bScoresAreEntered,1,2)

This also fails

= bScoresAreEntered

I am using Excel 2003.

The spreadsheet is named golf.xlsm

I have checked that macros are enabled.

I have checked that the function is in no other place in golf.xlsm.

I have copied and pasted the function name into the equation.

I have closed and re-opened the module multiple times after making changes.

I have searched the internet but found no help there.

Thank you.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. HansV 462.6K Reputation points
    2016-08-06T16:56:22+00:00

    When using a function in a formula, you must always place a pair of parentheses after the function name:

    =bScoresAreEntered()

    and

    =IF(bScoresAreEntered(),1,2)

    Was this answer helpful?

    0 comments No comments