• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Renaming existing functions

bctyner

New Member
I've seen tutorials on creating your own function, but is it possible to rename existing functions?


In my department, we use the term "mean" instead of "average." Can I tamper with the average function so that I can type =MEAN and have it work the exact same way?
 
Short answer, no. The closest you might be able to come would be to create your own function that works similar to the same way AVERAGE does, but it would not run as fast as the built-in AVERAGE function.

Another approach would be to have XL change the formula as you go, using an event macro like this one. Right-click on sheet tab, view code and then paste this in:

[pre]
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
Application.EnableEvents = False
If Left(Target.Formula, 1) = "=" Then
Target.Formula = WorksheetFunction.Substitute(UCase(Target.Formula), "MEAN", "AVERAGE")
End If
Application.EnableEvents = True
End Sub
[/pre]
 
Back
Top