Whats Next

In this chapter you learned the difference between subroutine procedures that perform actions and function procedures that return values. While you can create subroutines by recording or typing, function procedures cannot be recorded because they can take arguments. You must write them manually. You saw examples of function procedures called from a worksheet and from another Visual Basic procedure.

You learned how to pass arguments to functions and determine the data type of a function's result. You increased your repertoire of VBA keywords with the ByVal, ByRef, and Optional keywords. You also saw how problems can be broken into simpler and smaller tasks to make your programs easier to understand. Finally, you learned how subprocedures can pass values back to the calling procedures with the help of parameters.

After working through this chapter, you should be able to create some custom functions of your own that are suited to your specific needs. You should also be able to interact easily with your procedure users by employing the MsgBox and InputBox functions. Chapter 5 introduces you to decision making. You will learn how to change the course of your VBA procedure based on the results of the conditions that you supply.

0 0

Post a comment