3.1. Testing a Macro in the Visual Basic Editor
If a macro fails when you try to run it from the host application, the quickest way to find out what's going wrong is to open the macro in the Visual Basic Editor, run it, and see where it fails.
In the host application, press Alt+F8 or choose Tools Macro Macros to display the Macro dialog box.
Select the macro, and then click the Edit button. The host application opens an instance of the Visual Basic Editor and displays the macro for editing.
Start the macro running by pressing F5, choosing Run, or ...