VBA is now at a decision point. It adds 1 to the variable I. I is now equal to 11, which is greater than the limit in the For...Next loop. VBA then moves execution to the next line in the macro after the Next statement (see Figure 5.6). In case you are tempted to use the variable I later in the macro, it is important to realize that it might be incremented beyond the limit specified in the To clause of the For statement.

Figure 5.6

After incrementing I to 11, code execution moves to the line after the Next statement.

| (General)

0 0

Post a comment