Assignment statement examples

In the assignment statement examples that follow, the expressions are to the right of the equal sign:

x = (y * 2) / (z * 2) HouseCost = 375000 FileOpen = True Range("TheYear").Value = 2 007

Expressions can be as complex as you need them to be. Use the line continuation character (a space followed by an underscore) to make lengthy expressions easier to read.

Often, expressions use functions: VBA's built-in functions, Excel's worksheet functions, or functions that you develop with VBA. I discuss functions in Chapter 9.

0 0

Post a comment