

How Excel treats a user-defined function (UDF), what it permits the function to do, and how it recalculates the function are all determined when you register the function. They are not considered thread safe starting in Excel 2007. They can obtain the values of uncalculated cells including the values of the calling cells. They can access macro sheet information functions. The following is true of Excel macro-sheet functions: They can be written and registered as thread-safe starting in Excel 2007. They cannot obtain the values of uncalculated cells. They cannot access macro sheet information functions. The following is true of Excel worksheet functions: Excel does not limit user-defined macro sheet functions only to being used on macro sheets: these functions can be used anywhere a normal worksheet function can be used. They can be used in conditional formatting limit and threshold expressions.Įxcel makes a further distinction between user-defined worksheet functions and user-defined functions that are designed to work on macro sheets. They can be used in defined name definitions. They can be entered into one or more cells as part of an Excel formula. They usually take arguments and always return a result. They cannot be called by functions during a recalculation. They are never called by Excel during a recalculation. They can be linked to control objects so that they are called when some action is taken on that object, such as left-clicking.

They can display dialog boxes and interact with the user. They can be set up to be called when certain trapped events occur. They can do anything a user can do (subject to the limits of the interface used), such as altering Excel settings, opening, closing, and editing documents, initiating recalculations, and so on. They perform actions in the same way that users do. In Excel, commands have the following characteristics: Microsoft Excel recognizes two very different types of added functionality: commands and functions. Applies to: Excel 2013 | Office 2013 | Visual Studio
