Debugging and editing a VBA macro
You can debug VBA macros. Debugging lets you step through code line by line to ensure that a macro executes properly. For example, if you are at a point in the code where a variable is about to be assigned a value, you can step into this line of code to determine the value of the variable at runtime.
You can also edit a VBA macro. Editing a macro involves going directly to start of the code, whereas debugging lets you step through each line of the code.
To debug a VBA macro |
1.
|
|
Click Tools Visual Basic Play.
|
2.
|
|
Choose a macro from the Macro name list box.
|
3.
|
|
Click Step into.
|
4.
|
|
In Microsoft Visual Basic, click Debug Step into.
|
5.
|
|
Modify the code.
|
To edit a VBA macro |
1.
|
|
Click Tools Visual Basic Play.
|
2.
|
|
Choose a macro from the Macro name list box.
|
3.
|
|
Click Edit.
|
4.
|
|
Edit the code as necessary.
|
•
|
|
For more information about editing VBA, see the Microsoft Visual Basic Help in the Visual Basic Editor.
|