Excel UDF Name is Valid Cell Reference

Locates public User-Defined Function procedures accidentally named after a cell reference.


Another good reason to avoid numeric suffixes: if the function is meant to be used as a UDF in a cell formula, the worksheet cell by the same name takes precedence and gets the reference, and the function is never invoked.

Default severity


Inspection type


This inspection will only run when the Excel library is referenced


This example should trigger a result

MyModule (StandardModule)
Public Function FOO1234() End Function

This example should NOT trigger a result

MyModule (StandardModule)
Public Function Foo() End Function

Rubberduck.CodeAnalysis.Inspections.Concrete.ExcelUdfNameIsValidCellReferenceInspection.cs (Prerelease-v2.5.9.6289)