How to create Custom Functions (Excel 2007 – Excel 2010)


To totally unlock this section you need to Log-in


Login

Although Microsoft Office Excel 2007 includes a multitude of built-in worksheet functions, chances are it doesn’t have a function for every type of calculation you perform. The designers of Excel couldn’t possibly anticipate every calculation need of every user. So instead, Excel 2007 provides you with the ability to create custom functions, which are explained in this article.

Creating a Simple Custom Function

Custom functions, like macros, use the Visual Basic for Applications (VBA) programming language. They differ from macros in two significant ways. First, they use function procedures instead of sub procedures. That is, they start with a Function statement instead of a Sub statement and end with End Function instead of End Sub. Second, they perform calculations instead of taking actions. Certain kinds of statements (such as statements that select and format ranges) are excluded from custom functions. In this article, you’ll learn how to create and use custom functions.

Suppose your company offers a quantity discount of 10 percent on the sale of a product, provided the order is for more than 100 units. In the following [gs paragraph]s, you’ll build a function to calculate this discount.

To totally unlock this section you need to Log-in


Login

1 thought on “How to create Custom Functions (Excel 2007 – Excel 2010)”

Comments are closed.