O'Reilly logo

Excel VBA Programming For Dummies, 3rd Edition by John Walkenbach

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 20

Creating Worksheet Functions — and Living to Tell about It

In This Chapter

arrow Knowing why custom worksheet functions are so useful

arrow Exploring functions that use various types of arguments

arrow Understanding the Insert Function dialog box

For many macro mavens, VBA’s main attraction is the capability to create custom worksheet functions — functions that look, work, and feel just like those that Microsoft built into Excel. A custom function offers the added advantage of working exactly how you want it to (because you wrote it). I introduce custom functions in Chapter 5. In this chapter, I get down to the nitty-gritty and describe some tricks of the trade.

Why Create Custom Functions?

You are undoubtedly familiar with Excel’s worksheet functions — even Excel novices know how to use common worksheet functions, such as SUM, AVERAGE, and IF. By my count, Excel 2013 contains more than 450 predefined worksheet functions. And if that’s not enough, you can create functions by using VBA.

With all the functions available in Excel and VBA, you may wonder why you would ever need to create functions. The answer: to simplify your work. With a bit of planning, custom functions are very useful ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required