Building VBA Expressions

Understanding Expressions 53

Working with VBA Operators 54

Understanding Operator Precedence 57

Working with Numeric Expressions 60

Working with String Expressions 63

Working with Logical Expressions 66

Working with Date Expressions 68

The VBA variables you learned about in the Chapter 3, "Understanding Program Variables," don't amount to a hill of beans unless you do something with them. In other words, a procedure or function is merely a lifeless collection of Dim statements until you define some kind of relationship among the variables and your program objects. (I'll talk about the latter in Chapter 5, "Working with Objects.")

To establish these relationships, you need to create expressions that perform calculations and produce results. This chapter takes you through some expression basics and shows you a number of techniques for building powerful expressions using not only variables, but also VBA's built-in functions.

0 0

Post a comment