O'Reilly logo

Absolute Beginner's Guide to VBA by Paul McFedries

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

3. Understanding Program Variables

In This Chapter

• Learning why variables are useful

• Declaring variables for use in your macros

• Understanding the different types of variables

• Learning to use array variables and constants

• Using techniques that help you avoid the most common variable errors

Your VBA procedures often will need to store temporary values for use in statements and calculations that come later in the code. For example, you might want to store values for total sales and total expenses to use later in a gross margin calculation. Although you probably could get away with using the underlying application to store these values (in, say, a cell in an Excel worksheet), this almost always isn't very practical. Instead, VBA (like ...

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