I can write the following valid VBA functions:
Public Function C() As Long
C = 5
End Function
Public Function R() As Long
R = 6
End Function
But I can't use them in an Excel formula, without qualifying them with the VBA project or module name.
FWIW, Function N
and Function T
are valid too, but they clash with built-in functions.
I think C
and R
must be reserved names in Excel formulas, but I don't understand why. Any use of C
/R
as function calls would be parseable as function calls because they would be immediately followed by a (
, whereas any use of C
/R
as R1C1 notation would not be immediately followed by a (
.
Interstingly, I can call the functions if I qualify the function call with the name of the project and/or module:
=VBAProject.C()
5
=Module1.C()
5
=VBAProject.Module1.C()
5