O'Reilly logo

Mastering VBA for Microsoft® Office 2010 by Richard Mansfield

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 16. Building Modular Code and Using Classes

This chapter shows you how to start building modular code—code broken up into individual components rather than all built together into a monolithic lump. You'll also see how to approach creating reusable code that you can use in other procedures.

The second part of this chapter discusses how you can build and use your own classes in VBA to implement custom objects, store information in them, and return information from them.

In this chapter you will learn to do the following:

  • Arrange your code in modules

  • Call a procedure

  • Pass information from one procedure to another

  • Understand what classes are and what they're for

  • Create an object class

Creating Modular Code

The code that you've created so far in this ...

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