XL5: Using Case to Enhance Custom Function NamesID: Q104529
|
When you enter a worksheet or macro sheet function in Microsoft Excel,
if the function is spelled correctly and if the argument syntax is
correct, the function will be converted to capital letters when you
press the ENTER key.
When you create a custom function, the name that you use to define it
determines how the function appears in the Paste Function dialog box
and when you enter it correctly on a sheet. This name is case
specific. For example, if you use a name that is in all lowercase
letters, it will appear in lowercase in the Paste Function dialog box
and when you enter it on your sheet.
TIP: Use a name that is a mixture of uppercase and lowercase letters
or is in all uppercase letters. That way you'll know that it has
correct spelling and syntax when you enter it (because the function
name will be converted to the mixture of uppercase and lowercase
letters or will appear in all uppercase letters, depending on how you
originally defined it).
In Microsoft Excel 4.0 macro sheets, you can use the Define Name
dialog box to define a custom function. If you define a function with
the name, MyFunction, and then enter this function on a sheet, the
letters "M" and "F" will be displayed as uppercase letters. If you
instead define the function using all uppercase letters, MYFUNCTION,
it appears in all uppercase when you enter it on a sheet. Function
procedures in Visual Basic modules work in a similar manner. That is,
the case of a custom function name is determined by how it appears in
a variable declaration statement (if there is one) and in how it
appears in the procedure.
For example, if you have the following function procedure:
Dim CUBE as Integer
Function CUBE(Num)
CUBE = Num^3
End Function
Additional query words:
Keywords :
Version : 4.00 4.00a 5.00
Platform : WINDOWS
Issue type :
Last Reviewed: April 7, 1999