Stepping Through Statements

Stepping is the process of executing one statement at a time. Stepping through statements is sometimes referred to as tracing. After executing each statement, you can see how the statement affected the variables and objects in your macro.

To step through code one statement at a time

Step Into button

  • On the Run menu, click Step Into, or click the Step Into button on the Visual Basic toolbar.
  • When the Step Into command is carried out, Visual Basic executes the current statement and then automatically advances to the next statement and enters break mode.

    A line of code can contain two or more statements separated by a colon (:). You can step from one statement to the next even if they're in the same line. However, the breakpoint is always the first statement in the line.