STEP
Macro Sheets Only
Stops the normal flow of a macro and calculates it one cell at a time. Running a macro one cell at a time is called single-stepping and is very useful when you are debugging a macro. Use the STEP function, instead of choosing the Step button in the Macro dialog box when you want to start single-stepping at a specific line in a macro. The Macro dialog box appears when you choose the Macro command on the Tools menu.
Syntax
STEP( )
Remarks
- When Microsoft Excel encounters a STEP function, it stops running the macro and displays a dialog box. The dialog box tells you which cell in the macro Microsoft Excel is about to calculate, and what formula is in that cell. You can choose Step to carry out the next instruction; choose Evaluate to calculate part of the formula; choose Halt to interrupt the macro; or choose Continue to continue the macro without single-stepping.
You can evaluate the formula by holding down the SHIFT key while you click the Step button. You can also choose Step Over to carry out, but not step through, a user-defined function call; choose Pause, to suspend the macro so you can perform other tasks; and choose Goto, to stop the macro and select the cell being evaluated.
- When placed at the beginning of a macro, STEP is equivalent to choosing the Macro command from the Tool menu and selecting the Step button in the Macro dialog box.
- You can start single-stepping while a macro is running by pressing ESC in Microsoft Excel for Windows or by pressing ESC or COMMAND+PERIOD in Microsoft Excel for the Macintosh.
- The Single Step dialog box is initially displayed in the lower-right corner of the screen. You can move the dialog box if it's in your way. If you move it, it will remain in the new location until you stop single-stepping.
- To step through the calculation of a custom function, place the STEP function at the start of the custom function.
Related Functions
HALT Stops all macros from running
RUN Runs a macro
List of Control Functions