0 votes
in VBA by Beginner (29 points)
Debug drop down options
by Beginner (4 points)

The initial answer to all of your questions is in the Excel build in Help in the debugger.  Is there something in those definitions you don't understand?

Step Into, Step Over, Step Out Commands (Debug Menu)

Step Into

Executes code one statement at a time.

When not in design mode, Step Into enters break mode at the current line of execution. If the statement is a call to a procedure, the next statement displayed is the first statement in the procedure.

At design time, this menu item begins execution and enters break mode before the first line of code is executed.

If there is no current execution point, the Step Into command may appear to do nothing until you do something that triggers code, for example click on a document.

Step Over

Similar to Step Into. The difference in use occurs when the current statement contains a call to a procedure.

Step Over executes the procedure as a unit, and then steps to the next statement in the current procedure. Therefore, the next statement displayed is the next statement in the current procedure regardless of whether the current statement is a call to another procedure. Available in break mode only.

Step Out

Executes the remaining lines of a function in which the current execution point lies. The next statement displayed is the statement following the procedure call. All of the code is executed between the current and the final execution points. Available in break mode only.

Run to Cursor Command (Debug Menu)

When your application is in design mode, use Run To Cursor to select a statement further down in your code where you want execution to stop. Your application will run from the current statement to the selected statement and the current line of execution margin indicator appears in the Margin Indicator bar.

You can use this command, for example, to avoid stepping through large loops.

Keyboard shortcut:  CTRL+F8.

 
Edit Watch Command (Debug Menu)

Displays the Edit Watch dialog box in which you can edit or delete a watch expression. Available when the watch is set even if the Watch window is hidden.

This command displays the "Watch Window". It allows you to "watch" the current value of variables displayed in the Watch Window

Set Next Statement Command (Debug Menu)

Sets the execution point to the line of code you choose. You can set a different line of code to execute after the currently selected statement by selecting the line of code you want to execute and choosing the Set Next Statement command or by dragging the Current Execution Line margin indicator to the line of code you want to execute.

Using Set Next Statement, you can choose a line of code located before or after the currently selected statement. When you run the code, any intervening code isn't executed. Use this command when you want to rerun a statement within the current procedure or to skip over statements you don't want to execute. You can't use Set Next Statement for statements in different procedures.

by Beginner (29 points)
Thanks Ron.

What do you mean when you say "in design mode" & "outside design mode"?
by Beginner (0 points)
+1
Design mode is entered when in the vba screen, you can click the pnecil and ruler icon next to the stop button. This puts the vba into "design Mode" so you can do things around certain macro's.

 

I use it when i need to save a spreadsheet against a macros rule (i.e. do not allow saving if cell A1 is blank)

1 Answer

0 votes
by Super Expert (3.2k points)
 
Best answer

This question is marked as answered based on @Ron007's comment.

Welcome to wellsr Q&A
Ask any questions you have about VBA and Python and our community will help answer them. wellsr Q&A is the standalone question and answer platform for wellsr.com. If you have a question about one of our specific tutorials, please include a link back to the tutorial.

Getting Started
Register
VBA Cheat Sheets (On Sale Now)

Looking for something else? Hire our team directly through ourVBA Help page, instead.

For more programming tips visit the VBA Tutorials Blog and the Python Tutorials Blog.

...