I already answered a similar question here, about periods .
in a name, but I'm unsure about whether the same rule holds for backslashes.
Is it possible to write a UDF in VBA that contains a period in the name?
If the UDF is written in an external library, will the library allow backslashes in function names, and will Excel allow me to use that function name in a worksheet formula? Will excel require me to escape the character in some way?
Or, perhaps a backslash is valid when used to escape another character?
If you are talking about an UDF created via the Excel C API (XLL based), it is possible.
You just need to register the name (argument pxProcedure
in xlfRegister) with an escape character (i.e to register My\Func
you employ My\\Func
). Then you can call it directly from a cell without escaping the character.
See below (also with two backslashes) :
[
Edit : With a single backslash character :