Executing Function procedures using a worksheet formula
Unlike Sub procedures, Function procedures cannot be executed directly. In fact, they can be executed only in two ways: by another procedure, or with a worksheet formula.
In this recipe, we will be executing the Exponent Function procedure from within Excel. It is done in exactly the same way as any of the other worksheet functions in Excel; you click on a cell, type the =
(equals) sign, and move on from there.
Let's go through the steps and see how it's done.
Getting ready
Make sure that Excel is still open in the same workbook that we've been working with so far.
How to do it…
To execute, or call a function in Excel, do the following:
- Click on any open cell on Sheet1. As with any other function, press =.
- Now type
exponent
to call up the function we created earlier. - Press Tab to activate the function. After the first parenthesis, type
5,2
and press Enter. - The result...