

Press Alt+F11 to switch to the worksheet shown in Figure 1.

Now you're ready to use the new DISCOUNT function. A new module appears, as shown in Figure 2.įigure 2 Clicking Insert, Module adds a new module to the workbook. Press Alt+F11 to open the Visual Basic Editor, and then click Insert, Module. To create a custom DISCOUNT function in this workbook, follow these steps: The worksheet in Figure 1 shows an order form that lists each item, the quantity, the price, the discount (if any), and the resulting extended price. In the following paragraphs, you'll build a function to calculate this discount. 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.
Microsoft office excel 2007 tutorial how to#
In this article, you'll learn how to create and use custom functions. Certain kinds of statements (such as statements that select and format ranges) are excluded from custom functions. Second, they perform calculations instead of taking actions. That is, they start with a Function statement instead of a Sub statement and end with End Function instead of End Sub. First, they use function procedures instead of sub procedures. They differ from macros in two significant ways. Creating a Simple Custom FunctionĬustom functions, like macros, use the Visual Basic for Applications (VBA) programming language.

So instead, Excel 2007 provides you with the ability to create custom functions, which are explained in this article. The designers of Excel couldn't possibly anticipate every calculation need of every user. Making Your Custom Functions Available AnywhereĪlthough 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. To learn more about other books on the 2007 Microsoft Office system, visit Microsoft Press. He has also written music reviews for such well-known publications as Billboard, the Boston Globe, and the Christian Science Monitor. In addition to being a coauthor on Running Microsoft Excel, he is the coauthor of Running Microsoft Windows NT® Workstation, Version 4.
Microsoft office excel 2007 tutorial Pc#
Mark has been honored with six awards from the Society for Technical Communication.Ĭraig Stinson has been an industry journalist since 1981, serving as a contributing editor of PC Magazine and author of the several editions of the best-selling Running Microsoft Windows®. He was also a technical editor for over a dozen books on Microsoft applications. Mark Dodge is a former senior technical writer for the Microsoft Office User Assistance group, and is the coauthor of four editions of Running Microsoft Excel.
